Function::Internal
SetValue
SetValue("MyField","NewValue")
SetValue("CustomerName",CustomerName)
Retval := SetValue("RecordID",highest of Customers RecordID) .
SetValue("MyField#12","Test") -- will set the value Test in clone 12 of the GUI object MyField.

This is a bridge between PRISM and GUI where you can set the value contained in a GUI column into a FORM EditControl.

This function can be used to populate the GUI Editcontrol of any FORM EditField including Memo but will only transfer up to 255 characters.

This is the function to use if you want to return values to the active form from an ExecDQL as you cannot populate directly with Modify Records as this will corrupt the active record (you will get a "Record has changes since read!" error message.

You can also use this to push values inside the form as traditional DataEase functions are PULL (derived), SetFunctions including SetValue() are push so you can force consequence. Ex.: If you derive virtual fields based on COLUMNA you can push a value into COLUMNA and the virtual fields will be triggered.

Set a value in a different field from a derivation, action or script.

This function push a value into another field. combine with SetFocus and SetColor for impact and flow.

Returns empty string so it can be called from any derivation without interfering with result.

Parameters

ObjectName: Text

GUI Name of control, not to be confused with Field/Column name. GUI object name is text and need to be called with "".

Value: Text

All GUI Field control values are text in the GUI. DataEase will automatically translate to the correct column type. If you insert a number or a date etc, you need to format it correctly for the language of the active DataEase.

Returns/Result

Nothing.
Examples

Example 1:

Reference
Note!

All Set/Get Functions can be called with the # extension.A column name is unique inside a table, but a GUI object name is NOT unique in a DataEase form. You can't insert two objects in the same record object with the same name, but you can have many objects with the same name as long as they are in different record objects.

When you make a multi-record object like a Sub Form, DataEase will lone the GUI controls the same number as you have records. If you have a Subform with 10 rows, you will have 10 objects with the same name (clones).

With Set/Get functions you can address all of these directly by adding the correct number.

The first row will be number 1 and the last number 10.

PS! Remember that if you have the same column earlier in the form, you will have to add the number of previous columns into the equation.

Ex:


You have a Order/Orderline form where Ordernr is the key. You have OrderNr in both the main record and in the subform.

OrderNr#1 will then be the Main Record OrderNr and the first one in the OrderLines will be OrderNr#2.

Any other object in the Orderlines record will start with 1 as long as they are unique to the orderlines.

Numbering in DataEase is from top to bottom and left to right, so any object that is higher up than any other is ahead in the order. If objects is on the exact same height the one furthest to the left is the first. This is on Pixel level, so one pixel is enough to change the order.