.



Core Functions    
Macros

Macros - Use with Further Fields

If you need to use values stored in Further Fields in your macros, these can be obtained using the FurthFld Get function.

This can have up to three parameters: the first is the Enterprise 6 File Name, the second is the Name of the Further Field and the third is the unique Code of the relevant record - such as the Company Code. The third parameter is optional: if left unspecified, the current value of the relevant Further Field of the specified File will be taken.

As shown in the following example, the value will be returned as text, whatever the Type of the Further Field. If simply displaying numeric or date data you will not need to convert it, but if you need to incorporate the value in a calculation, you will need to convert it to the appropriate type using the Num (as shown) or Date functions.

mTurnover:=Num(FurthFld Get ("Companies";"Turnover";"ACI1/999"))

You can also use a macro to change the value stored in a Further Field, using the FurthFld Set command. The first two parameters are the same as those for FurthFld Get, while the third is the value that you wish to be stored, converted to text type. The optional fourth parameter is the unique record identifierm as for the third parameter of FurthFld Get. This takes the same parameters except that the optional third parameter above becomes the fourth. The function returns an integer: 0 if the process is completed without a problem, 1 if the Value could not be set (perhaps because the record was locked by another user), or 2 if the parameters were invalid. An example might be:

mTurnover:=Num(FurthFld Get ("Companies";"Turnover";"ACI1/999"))

mTurnover:=mTurnover*1.1

mErr:=FurthFld Set ("Companies";"Turnover";String(mTurnover);"ACI1/999")

If (mErr=0)

  ...

End if

There is no need to issue a Save Record after using FurthFld Set.

Note that FurthFld Set and FurthFld Get cannot be used to bypass the Access and Read Only settings of a particular Further Field allocated in Personnel.



 

Published date: v1.1.1.1 Fri, 09 Mar 2007 12:54:01 GMT

© 2006 - 2007 Daybook Limited, All trademarks accepted. All Rights Reserved!
Site Index