|
|
Related Menu Script
Adds the Script Name to the drop-down Menu held against the ‘Related’ button within specific screens. The Related script can optionally take key information from the current screen and show specific - related - information. In the following example we will add a Related Script called ‘Job Customer’ and whenever you are in a Job Screen this script will take you to the Customer Detail screen related to this Order’s Customer
Go into File>Custom Scripts and create a new Script called ‘Job Customer’. In the ‘Detail’ tab ‘check’ the ‘Add to this Screen’ checkbox and select ‘Job Orders’ from the drop-down list in the adjacent field. In the ‘Script’ tab add the following script
begin
RunSystemAction('Sales', 'Customers');
SetScreenParameter('KEYFIELD=CUSTOMER');
SetScreenParameter('KEYVALUE=' + GetSourceFieldValue('CUSTOMER'));
SetScreenParameter('TABINDEX=1'); // This will open up in the Customer ‘Detail’ screen rather than the ‘List’ screen
end.
Save and exit the Custom Script screen.
Go into Jobs>Job Orders and click on the ‘Related’ button. You will find that the ‘Job Customer’ Custom Script appears in the drop-down list. If you select this then the script will bring up the Customer Screen relating to this Job Order.