Results 1 to 3 of 3

Thread: I am trying to use a new field in webappuser table to constrain the user by

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jul 2015
    Location
    New Zealand
    Posts
    227

    Default Re: I am trying to use a new field in webappuser table to constrain the user by

    Thank you Harm I have been able resolve the above issue

    I have another couple of web apps with another problem, I am trying to replicate a timesheet entry screen in mobile and desktop web app

    I have underlined links in the header when I click on the links the data appears

    The problem is nothing displays in the grid until I click on the header below is the code can u help please

    Code:
    // C:\DataFlex Projects\MTimeSheet\AppSrc\WorkCenterZoom.wo
    // WorkCenterZoom
    //
    Use cWebView.pkg
    Use cWebPanel.pkg
    Use cWebMenuGroup.pkg
    Use cWebMenuItem.pkg
    Use cWebForm.pkg
    Use cWebList.pkg
    Use cWebColumn.pkg
    Use cWebGroup.pkg
    Use EntHours.wo
    Use SUPER.DD
    Use EMPLOY.DD
    Use PRGRP.DD
    Use UNITS.DD
    Use STOCK.DD
    Use STKLOC.DD
    Use STKPNT.DD
    Use PRGRP2.DD
    Use PrGrp3.dd
    Use Stk2.dd
    Use CRED2.DD
    Use STKSLK.DD
    Use ASSEMBLY.DD
    Use STKSUB.dd
    Use STKLKUP.DD
    Use cStklkup2DataDictionary.dd
    Use CREDITOR.DD
    Use EXCHANGE.DD
    Use STKPLK.DD
    Use cMrpheadDataDictionary.dd
    Use STK3.dd
    Use WRKCTR.DD
    Use cMrpprodDataDictionary.dd
    Use cCred3DataDictionary.dd
    Use cStkloc3DataDictionary.dd
    Use cCred4DataDictionary.dd
    Use cEmp4DataDictionary.dd
    Use cMrptimeDataDictionary.dd
    
    Object oWorkCenterZoom is a cWebView
        Set piColumnCount to 12
        Set psCaption to "WorkCenterZoom"
        Set peWebViewStyle to wvsDrilldown
        Set peViewType to vtZoom
        Set pbShowCaption to False
        Set Verify_Save_Msg to 0
        Set piMaxWidth to 1024
        Object oSuper_DD is a Super_DataDictionary
        End_Object
        Object oEmp4_DD is a cEmp4DataDictionary
            Set DDO_Server to oSuper_DD
        End_Object
    //            Object oCurrency_DD is a cCurrencyDataDictionary
    //            End_Object
                Object oCred4_DD is a cCred4DataDictionary
    //                Set DDO_Server to oCurrency_DD
                End_Object
                Object oCred3_DD is a cCred3DataDictionary
    //                Set DDO_Server to oCurrency_DD
                End_Object
    //
    //            Object oLedger_DD is a Ledger_DataDictionary
    //                Set DDO_Server to oTaxlkup3_DD
    //            End_Object
    //            Object oDeptmast_DD is a Deptmast_DataDictionary
    //            End_Object
                Object oWrkctr_DD is a Wrkctr_DataDictionary
                    //Set DDO_Server to oDeptmast_DD
                End_Object
        Object oPrgrp_DD is a Prgrp_DataDictionary
        End_Object // oPrgrp_DD
        Object oPrgrp2_DD is a Prgrp2_DataDictionary
        End_Object // oPrgrp2_DD
        Object oPrgrp3_DD is a PrGrp3
        End_Object // oPrgrp3_DD
        Object oUnits_DD is a Units_DataDictionary
        End_Object // oUnits_DD
                Object oStk3_DD is a STK3
                    Set DDO_Server to oUnits_DD
                    Set DDO_Server to oPrgrp3_DD
                    Set DDO_Server to oPrgrp2_DD
                    Set DDO_Server to oPrgrp_DD
                End_Object
    //    Object oStk2_DD is a cStk2DataDictionary
    //        Set DDO_Server to oPrgrp_DD
    //        Set DDO_Server to oPrgrp2_DD
    //        Set DDO_Server to oPrgrp3_DD
    //        Set DDO_Server to oUnits_DD
    //    End_Object // oStk2_DD
        Object oStkslk_DD is a Stkslk_DataDictionary
    //        Set DDO_Server to oStk2_DD
        End_Object // oStkslk_DD
    //    Object oStklkup_DD is a Stklkup_DataDictionary
    //    End_Object // oStklkup_DD
                Object oStkloc3_DD is a cStkloc3DataDictionary
    //                Set DDO_Server to oStklkup_DD
                End_Object
                Object oStklkup2_DD is a cStklkup2DataDictionary
    //                Set DDO_Server to oStklkup_DD
                End_Object
        Object oMrphead_DD is a cMrpheadDataDictionary
            Set DDO_Server to oCred3_DD
            Set DDO_Server to oStklkup2_DD
            Set DDO_Server to oStk3_DD
    //        Set DDO_Server to oStklkup_DD
            Begin_Constraints
                Constrain MRPHEAD.COMPLETE Ne "N"
            End_Constraints
        End_Object // oMrphead_DD
                Object oMrpprod_DD is a cMrpprodDataDictionary
                    Set DDO_Server to oWrkctr_DD
                    Set Constrain_file to MRPHEAD.File_number
                    Set DDO_Server to oMrphead_DD
                End_Object
        Object oMrptime_DD is a cMrptimeDataDictionary
            Set DDO_Server to oEmp4_DD
            Set Constrain_file to MRPPROD.File_number
            Set DDO_Server to oMrpprod_DD
        End_Object
    //    Object oMrpdet_DD is a cMrpdetDataDictionary
    //        Set DDO_Server to oCred4_DD
    //        Set DDO_Server to oStkloc3_DD
    ////        Set DDO_Server to oStkslk_DD
    //        Set DDO_Server to oMrphead_DD
    //        Set Constrain_File to Mrphead.File_Number
    //    End_Object // oMrpdet_DD
        Set Main_DD to oMrpProd_DD
        Set Server  to oMrpProd_DD
    
        Object oWebMainPanel is a cWebPanel
            Set piColumnCount to 12
            WebSetResponsive piColumnCount rmMobile to 4
            
                Procedure OnLoad
                    Send Find of oMrpProd_DD FIRST_RECORD 1
                    Send GridRefresh to oDetailGrid
                 End_Procedure
            
            
            Object oWebGrpWO is a cWebGroup
                Set psCaption to "Works Order"
                Set piColumnCount to 12   
                        Object oMRPHEADKEY is a cWebForm
                            Entry_Item MRPHEAD.KEY
                            Set piColumnSpan to 2
                            Set piColumnIndex to 0
                            Set peLabelPosition to lpTop
                            Set psLabel to "Works Order"
                        End_Object 
                
                        Object oSTKLKUP2_CODE is a cWebForm
                            Entry_Item STKLKUP2.CODE
                            Set piColumnSpan to 3
                            Set psLabel to "For Branch"
                            Set peLabelPosition to lpTop
                            Set piColumnIndex to 2
                        End_Object
                
                        Object oSTKLKUP2_DESCRIPTION is a cWebForm
                            Entry_Item STKLKUP2.DESCRIPTION
                            Set piColumnSpan to 7
                            Set psLabel to "Factory"
                            Set peLabelPosition to lpTop
                            Set piColumnIndex to 5
                        End_Object
                
                        Object oMRPHEAD_DATECALC is a cWebForm
                            Entry_Item MRPHEAD.DATECALC
                            Set piColumnSpan to 6
                            Set psLabel to "Date Calulated"
                            Set peLabelPosition to lpTop
                        End_Object
                
                        Object oMRPHEAD_DATE_RELEASED is a cWebForm
                            Entry_Item MRPHEAD.DATE_RELEASED
                            Set piColumnSpan to 6
                            Set psLabel to "Date Released"
                            Set peLabelPosition to lpTop
                            Set piColumnIndex to 6
                        End_Object
                
                        Object oSTK3_CODE is a cWebForm
                            Entry_Item STK3.CODE
                            Set piColumnSpan to 3
                            Set psLabel to "Item"
                            Set peLabelPosition to lpTop
                        End_Object
                
                        Object oSTK3_DESCRIPTION is a cWebForm
                            Entry_Item STK3.DESCRIPTION
                            Set piColumnSpan to 7
                            Set psLabel to "Description"
                            Set peLabelPosition to lpTop
                            Set piColumnIndex to 3
                        End_Object
            
            End_Object// group
    
    
    ////////////////////////////////////////////////////////////////////////////////////////////////
            Object oDetailGrid is a cWebList
                Set piSortColumn to 0
                Set pbFillHeight to True
                Set piColumnSpan to 12
                Set psCSSClass to "MobileList"
                Set pbServerOnRowClick to True
                Set piMinHeight to 200
                
    //            Procedure OnLoad
    //                Send Find of oMrpProd_DD FIRST_RECORD 1
    //                Send GridRefresh to oDetailGrid
    //             End_Procedure
                
                Object oWRKCTR_CODE is a cWebColumn
                    Entry_Item WRKCTR.CODE
                    Set psCaption to "Work Center"
                    Set piWidth to 50
                End_Object
                Object oWRKCTR_DESCRIPTION is a cWebColumn
                    Entry_Item WRKCTR.DESCRIPTION
                    Set psCaption to " "
                    Set piWidth to 50
                End_Object
                Object oMRPPROD_DESC is a cWebColumn
                    Entry_Item MRPPROD.DESC
                    Set psCaption to "Description"
                    Set piWidth to 50
                End_Object
                Object oMRPPROD_UNITS is a cWebColumn
                    Entry_Item MRPPROD.UNITS
                    Set psCaption to "Units"
                    Set piWidth to 50
                End_Object
                Object oMRPPROD_ACTUAL_UNITS is a cWebColumn
                    Entry_Item MRPPROD.ACTUAL_UNITS
                    Set psCaption to "Actual Units"
                    Set piWidth to 50
                End_Object
    
                Procedure OnRowClick String sRowId
                    Register_Object oEntHours
                    Send NavigateForward of oEntHours Self
                End_Procedure
                Procedure OnGetNavigateForwardData tWebNavigateData ByRef NavigateData Handle hoToView
                    Move True to NavigateData.bReadOnly
                    Move True to NavigateData.bSaveBeforeNavigate
                End_Procedure
            End_Object//end weblist
            
        End_Object 
        Object oActionGroup is a cWebMenuGroup
            Object oSaveBtn is a cWebMenuItem
                Set psCSSClass to "WebSaveMenuItem"
                Set psCaption to "Save"
                Procedure OnClick
                    Send Request_Save
                End_Procedure
            End_Object 
            Object oEditBtn is a cWebMenuItem
                Set psCSSClass to "WebEditMenuItem"
                Set psCaption to "Edit"
                Procedure OnClick
                    Send ChangeEditMode True
                    Send SetActionButtons
                End_Procedure
            End_Object 
            Object oDeleteBtn is a cWebMenuItem
                Set psCSSClass to "WebDeleteMenuItem"
                Set psCaption to "Delete"
                Set peActionDisplay to adMenu
                Procedure OnClick
                    Send Request_Delete
                End_Procedure
            End_Object 
            Object oCancelChangesBtn is a cWebMenuItem
                Set psCSSClass to "WebRefreshMenuItem"
                Set psCaption to "Clear/Add"
                Set peActionDisplay to adMenu
                Procedure OnClick
                    Send RefreshRecord
                End_Procedure
            End_Object 
            Object oNewDetail is a cWebMenuItem
                Set psCaption to "New Detail Item"
                Set peActionDisplay to adMenu
                Set pbBeginGroup to True
                Procedure OnClick
                    Register_Object oEntHours
                    Send NavigateForward of oEntHours Self
                End_Procedure
                Procedure OnGetNavigateForwardData tWebNavigateData ByRef NavigateData Handle hoToView
                    Move True to NavigateData.bNewRecord
                    Move True to NavigateData.bSaveBeforeNavigate
                End_Procedure
            End_Object 
        End_Object 
        Procedure SetActionButtons
            tWebNavigateData NavigateData
            Boolean bHasRecord
            Handle hoDD
            Get Server to hoDD
            Get GetNavigateData to NavigateData
            Get HasRecord of hoDD to bHasRecord
            // let's hide all buttons and then Show the ones we want
            WebSet pbRender of oEditBtn to False
            WebSet pbRender of oSaveBtn to False
            WebSet pbRender of oCancelChangesBtn to False
            WebSet pbRender of oDeleteBtn to False
            WebSet pbRender of oNewDetail to False
            If (NavigateData.bReadOnly) Begin
                WebSet pbRender of oEditBtn to True
            End
            Else Begin
                WebSet pbRender of oSaveBtn to True
                WebSet pbRender of oCancelChangesBtn to True
                WebSet pbRender of oDeleteBtn to bHasRecord
                WebSet pbRender of oNewDetail to True
            End
        End_Procedure
        Procedure OnViewSaved Handle hoServer Boolean bChanged
            // Close after save
            Send NavigateClose Self
        End_Procedure
        // this will close the view after a delete
        Procedure OnViewDeleted Handle hoDDO
            Send NavigateClose Self
        End_Procedure
        Procedure OnNavigateForward tWebNavigateData NavigateData Integer hoInvokingView Integer hoInvokingObject
            Case Begin
                Case (NavigateData.eNavigateType=nfFromMain)
                    // If from main, this is a propbably a main file Select to Zoom.
                    Case Break
                Case (NavigateData.eNavigateType=nfFromParent)
                    // If from parent, this is a constrained drill down.
                    Case Break
                Case (NavigateData.eNavigateType=nfFromChild)
                    // If from child, this is a probably a parent Zoom from a Zoom.
                    Case Break
                Case Else // must be nfUndefined
            Case End
            Send SetActionButtons
        End_Procedure
    End_Object
    Last edited by Kevinw; 26-Oct-2016 at 09:45 PM.
    Regards,
    Kevin, Email kevin.bw.nz@gmail.com

    It may compile but does it run

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •