Obtaining Field Values

When setting global variables, passing values between entities, and calling database functions or procedures, values may need to be obtained from specific fields on the current entity.  The code should never be surrounded by quotes.  The code to obtain a value from a entities:

$$BLOCK.FIELD$$

For example, if the block is called custmast and the field from which the value must be taken is the cust_no field, the code would look like this:  $$CUSTMAST.CUST_NO$$

You can also use a generic reference that will search through the block hierarchy, beginning with the current block, to find the defined field.  The search begins in the current block, and if the field is not found, continues to the parent block, and its parent block, and so on. When searching for the defined field within the entity's block hierarchy, blocks that are not within the hierarchy are not considered.  The code for this is $$.FIELD$$.

This code is especially useful in creating list of values that can be used on multiple entities that may have the same field names but not the same block names.  For example, if blocks item_name and oedetl both contain a field named item_number, both could use a list of values with a reference to $$.ITEM_NO$$.

There are some cases in which you must add a .first modifier to the $$BLOCK.FIELD$$ reference in order to access the field value.  The code for this is $$BLOCK.FIELD.first$$

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.