JeanW
What I posted is the first part of the script.Will post entire script maybe it will help. I need help with the part between the dash lines.
Thanks
----------------------------------------------
Enter Browse Mode
If [ not IsEmpty(Get(ScriptParameter))]
Set Field [ Preferences: :aLastLavout Case ( Preferences: :gCurrentModule = Preferences:: HeIpModuIeID; Preferences: :gLastLayout; Get (LayoutNumber))]
Set Field [ Preferences::aCurrentModule Preferences::gNavID [ Get(ScriptParameter)]]
Set Field [ Preferences::aText Get ( LayoutName)]
Commit RecordslRequests
[No dialog]
Go to Layout [ “Settings” (Preferences)]
If [ not IsEm pty(AccountModulel nfo: : LastLayout)
Go to Layout [ AccountModulelnfo::LastLayout]
Else
-----------------------------------------------------
If [ Preferences::gCurrentModule = Preferences::HomeModulelD //Home section]
Go to Layout [ “Home (Date Range)” (Preferences DATE RANGE VIEW)]
Else If [ Preferences::gCurrentModule = Preferences::CompanyModulelD //Companies section] Go to Layout [ “Company List” (Company)]
Else If [ Preferences::gCurrentModule = Preferences::ContactsModulelD //Contacts section
Go to Layout [ “Contact List” (Contact)]
Else If [ Preferences::gCurrentModule = Preferences:

roductsModulelD //Products section
Go to Layout [ “Product List” (Product)]
Else If [ Preferences::gCurrentModule = Preferences::lnvoicesModulelD //Invoices section]
Go to Layout [ “Invoice List” (Invoice)]
Else If [ Preferences::gCurrentModule = Preferences::ReportsModulelD //Invoices section]
Go to Layout [ “Reports” (Preferences)]
Else If [ Preferences::gCurrentModule = Preferences::HelpModulelD //Help section]
Go to Layout [ “Help” (Preferences)]
Else If [ Preferences:: gCurrentModule = Preferences:: PreferencesModulel D //Preferences section
If [ PatternCount ( Get ( PrivilegeSetName) ; Data Entry)]
Go to Layout [ original layout]
Go to Related Record [ From table: “Account CURRENT”; Using layout: “Preferences” (Preferences)]
[Show only related records; New window]
Else If [ PatternCount ( Get ( PrivilegeSetName) ; Manager )]
Go to Related Record [ From table: “Account CURRENT”; Using layout: “Accounts” (Preferences)] [Show only related records]
Extend Found Set [ Specified Find Requests: Find Records; Criteria: Preferences:

rivileaeSet: Data Entry”] [Restore]
Else If [ PatternCount ( Get ( PrivilegeSetName) ; Full Access )]
Go to Layout [“Accounts” (Preferences)]
Show All Records
Else
Beep
Show Custom Dialog [ Title: No Access; Message: As a Guest, you dont have access to Preferences.; Buttons: “OK”]
End If
Else
Set Field [ Preferences:: aCurrentModule: Preferences:: gText]
Go to Layout [ original layout]
Beep
Exit Script []
End If
End If
Perform Script[....Clear Sort Headers"]
End If
Perform Scrip ["IWP Navigation"]