AnsweredAssumed Answered

Filter on startup not working...

Question asked by mcemond on Jan 25, 2016
Latest reply on Jan 25, 2016 by mcemond

Hi

I use a startup script to direct different privilege sets to the proper landing pages. The accounts under the "worker" privilege set are directed to the "Assignments" layout. The assignments layout has an OnLayoutEnter script trigger to a second script that filters the assignment records by status: Open and account name. So the user only sees their own open assignments. If I use a button to navigate to the assignments layout, the filter works fine. If I use the startup script, the workers see their own assignments but they see both open as well as finished assignments. My question is how can I get both filter criteria working when the app first opens using the startup script?  This effect is seen on both FMPro Advanced 13 as well as FM Go Latest version and file is hosted on a FM Server.

Thanks

Mike

 

The start up script (which works at identifying the correct landing page):

Set Variable [$PrivilegeSetVariable; Value:Get ( AccountPrivilegeSetName )]

Set Zoom Level [Lock; 100%]

If [$PrivilegeSetVariable = "worker"]

     Go to Layout ["AssignmentsLayout" (logTime)]

End If ... script simply goes on to identify other sets and direct them to their respective pages.

 

The onLayoutEnter script for the Assignments page:

Set Zoom Level [Lock; 100%]

Set Variable [$AccountNameVariable; Value:Get (AccountName)]

Enter Find Mode []

Set Field [workOrder::status; "Open"]

Set Field [crewAssignments::accountName; $AccountNameVariable]

Set Error Capture [On]

Perform Find []

Constrain Found Set []

Set Error Capture [Off]

Sort Records [Restore; No dialog]

Scroll Window [Home]

Outcomes