Data References

 

Expand/Collapse all Show/Hide All

Note This topic applies only to the Material Requirements Planning and Work Order modules.

Note This topic does not apply to Sage 100 Premium.

In both command and DDE scripts, you can make references to data from panel controls. Any data references in scripts must be enclosed in brackets [ ] or braces { }. Anything inside the brackets or braces is evaluated as a data reference. Use the brackets [ ] to enclose the evaluated data value in quotation marks (for example, "Data Value"). Use the braces { } if you do not want the data value to be enclosed in quotation marks.

The data value used is the data displayed at the time that you click the Link Control button.

If you need to use bracket [ ] or brace { } characters in your script, precede each bracket or brace with a backslash (\). For example, Insert "\[Hello\]" yields Insert "[Hello]".

Warning Verify that the Link Control button is placed on a panel that has access to the data values you are referencing from the script.

Panel Control Names

The most important information in a data reference is the panel control name; this name is assigned to each control on a panel. You can determine the name of a data control by selecting the control in the panel. The name and the grid position of the control appear in the Status Bar of the panel. Printing the Customizer Detail Report or accessing the Panel Map window from the Toolbar lists panel controls and their names.

A naming convention is used to identify the type of each control. For example, a multi-line control uses ML_ as the first three characters of its name. The remainder of the control name is descriptive text.

Expand/Collapse item  Panel Control Name Example

ML_CUSTOMER_NAME, BT_ACCEPT

The following are standard naming conventions:

BT_ Button control
CB_ Check box control
DB_ Drop box control
LB_ List box control
ML_ Multi-line control
RB_ Radio button control

Operators and Functions

Use operators and functions within a data reference to manipulate the data values. For example, you may want to reference only the first 10 characters of a name field, or you may want to strip trailing spaces.

Expand or collapse item Example

The following examples illustrate some common operators and functions that can be used in a linked script data reference.

Combine the data from ML_FIRST and ML_LAST data references.

ML_FIRST$ + ML_LAST$

Use a 10-character substring of the ML_NAME control starting with the first position.

MID (ML_NAME$,1,10)

Strip trailing blanks from the ML_NAME$ control.

STP(ML_NAME$)

Convert all characters in the ML_NAME$ control to uppercase.

UCS(ML_NAME$)

Strip both leading and trailing blanks and convert to uppercase.

UCS(STP(ML_NAME$,2))