A startup script example
In this example, a startup script customizes each user's view of the database upon startup. Based on the current user, the script displays the appropriate
layout for the current user and finds the records relevant to that user.
The first step displays the Welcome layout in the Sales table. The If script step evaluates the value returned by the
Get(AccountName) function and switches to the Simple layout if the value returned is Lynn. If the user name is not Lynn, the
Else If script step is evaluated, and if the value returned by the Get(AccountName) function in this step is Ann, the script switches to the Complex layout. Then the script uses
Insert Calculated Result script step to paste the user's account name into a field in Find mode to find all the records marked with the user's account name.
Go to Layout ["Welcome layout"]Pause/Resume Script [Duration (seconds); 3]
If [Get( AccountName )= "Lynn"]
Go to Layout ["Simple layout"]
Else If [Get( AccountName )="Ann"]
Go to Layout ["Complex layout"]
End If
Enter Find Mode[]
Insert Calculated Result [Select; "Sales::temp user name";
Get( AccountName )]
Perform Find[]