Insert Data Fields and Functions into a Script

 

Expand/Collapse all Show/Hide All

Expand/Collapse item  Overview

You can insert data fields and functions into a script using the External Link Definition window. You can reference controls in Sage 100 customized panels. You can also use control values from customized panels. For information on DDE scripts, see DDE Scripts.

Note  This procedure only applies to Sage 100 scripts. For information on MS Scripting, see Create an MS Script Link.

 

To insert data fields and functions into a script

  1. Select Custom Office Main menu > Customizer Selection.

  2. Select the panel to insert the data field or function into. For more information, see Select a Panel.

  3. On the Customizer Toolbar, click the Add External Link button.

  4. On the panel, click and drag to position the button.

  5. In the External Link Definition window, on the Link Setting tab, click Script Editor. For more information, see External Link Definition - Fields.

  6. In the Edit Script window, in the DDE Script field, position your cursor where you want to insert the data field or function. For more information, see Edit Script - Fields.

Note  To replace existing text, highlight the text to replace and proceed to the next step.

  1. In the Data Fields and the Functions fields, double-click a line item to place it in the script.

  2. Functions are always inserted with a set of parentheses (for example, STP( )). Type the argument, or insert a data field, inside the parentheses to complete the expression. You can also highlight a data field in the script and double-click the function to automatically enclose it in parentheses. Click OK.

Note  For DDE Scripts, enclose data reference expressions inside of either brackets [ ] or braces { }. Use brackets [ ] to enclose the data in quotation marks.

The data field or function is added to the script.

When you create a script file, the script is saved as a text file. The name of the script text file is specified in the File Name field on the External Link Definition Link Settings tab for image, multimedia, and DDE links and in the Program field for a program link. A default file name is assigned automatically but can be changed. Any .TXT file entered in the File Name or Program field is assumed to be a script file.

Because all scripts are stored in a file, you can re-use the same script file from multiple link controls, as long as all references to data fields are valid for the panel.