Easy to Create, Easy to Change - Easy to use!

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.

See Also


SetLabelText 12 September 2014
SetState 20 August 2014
SetStyle 24 July 2014
MemoSetGlobal() 22 July 2014
SetColor 22 July 2014
SetFocus 22 July 2014
SetMemoValue 22 July 2014
SetValue 22 July 2014
SetVar 22 July 2014
GetCurrent 17 November 2014
GetlabelText 22 July 2014
GetStyle 22 July 2014
GetValue 22 July 2014
GetVar 22 July 2014

On the forum about SetValue

setvalue getvalue

Following on from the 'Reporter' thread, which has gone haywire and is putting latest replies not at the bottom but in the middle of the thread!  I figured I'd start a new thread.I'm now having to learn QBM and ditch DQL as dataease no lon...

Product: Dataease [{8}]FIVE. Written by Simon B 09/09/14 at 15:31:40

Re:setvalue getvalue

The initial problem is that you have been advised to use the wrong function.If i am not mistaken Adrian took this from the top of his head and mixed them up. The format is the same but they do very different things. SetValue() and GetValu...

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 09/09/14 at 15:55:42

Re:Re:setvalue getvalue

Ahaaaaaaa! it worked! :DSmug look for doing a qbm that works.  Only taken me 20 years ... :D  Soooooo, I can now do a report using qbm and a dql for the data entry form to get the variables (an entered start and end date for the repor...

Product: Dataease [{8}]FIVE. Written by Simon B 10/09/14 at 08:25:12

setvalue

Can I, or How can I use setvalue in a Subform field....

Product: Dataease [{8}]FIVE. Written by Rainer 14/10/14 at 10:27:48

Re:setvalue

please answere...

Product: Dataease [{8}]FIVE. Written by Rainer 20/10/14 at 14:50:57

Re:setvalue

This is where the new policy of using our own products actively start to pay off....With the introduction of SetClass we opened Pandoras box. If one can do this on this kind of object one suddenly want to be able to do it on all kinds of objec...

Product: Dataease [{8}]FIVE. Written by DataEase 20/10/14 at 17:39:32

Re:Re:setvalue

Thank's. And what do I do if I want all the "MY Field" changed in the same way . Meens I have 1/n subrecords, and I want them all to get the value "KO" for examlpe?...

Product: Dataease [{8}]FIVE. Written by Rainer 20/10/14 at 19:05:53

Re:Re:Re:setvalue

please answere...

Product: Dataease [{8}]FIVE. Written by Rainer 29/10/14 at 18:49:34

Re:Re:Re:Re:setvalue

You have to run a loop that sets all the MYFields from 1 to n. Or you can do SetValue("MYField#1","KO")+SetValue("MYField#2","KO")+etc...To run a loop you need t use ExecDQL....

Product: Dataease [{8}]FIVE. Written by DataEase 30/10/14 at 07:11:09

Re:Re:Re:Re:Re:setvalue

can you please give an example for the loop.i can not do it this way ?retval := ExecDQL("for AUFTRAG_POSITION with Belegnr=data-entry Field1; setvalue("Belegart",global BART)+setvalue("Druck_KZ",global BART)",global Belegnr,"","","","")+...

Product: Dataease [{8}]FIVE. Written by Rainer 30/10/14 at 09:07:02

Re:Re:Re:Re:Re:Re:setvalue

Download Sample Firstly we need to get some basic rules in place.  "" is the delimiter of a string (text) in DataEase so you can't use " in...

Product: Dataease [{8}]FIVE. Written by DataEase 01/11/14 at 09:16:41

2 times SetValue on a Button

Hallo Dataease Forum,have a little problem: Code like this on a Button:SetValue("MaterialVS",Typ) + SetValue("Preisqm",VK_Preis)This Button is inside a Subform. The Fields are listed in this Subform and i want to take...

Product: Dataease [{8}]FIVE. Written by grohmann.papier@t-online.de 12/12/15 at 16:32:22

Re:2 times SetValue on a Button

My guess would be that the field that doesn't work have a different Object name i.e. you have renamed the field.Object names is the same as the Field name on fields as long as you don't change the field name. Object names and Fiel...

Product: Dataease [{8}]FIVE. Written by DataEase 12/12/15 at 19:35:06

Hmmm... jsSetValue

Hmmm.. try to use jsSetValue .But how ever i try it ,it will not tranfer valiue from html to my Form.Do have anyone succsess with it ?I have orientetd me at the demoscript in the helpindex.Are there some new infos for it or...

Product: Dataease [{8}]FIVE. Written by grohmann.papier@t-online.de 25/03/16 at 15:02:06

Re:Hmmm... jsSetValue

Hi Markus.Sorry, you are just too enthusiastic.For documentation purposes we list the functions in the help file as we make then, and sometimes that means that the functions are listed there ahead of them being released.These f...

Product: Dataease [{8}]FIVE. Written by DataEase 28/03/16 at 13:35:06

SetValue + MultiChoice Drop Box

Dear All,Can I select an option of a Multichoice field ( built with a lookup funtion as a result of a relationship between two tables), using setvalue function?Please see attached example what I'm trying to doThe ideia is to...

Product: Dataease [{8}]FIVE. Written by afonso santos 22/06/16 at 22:42:53

Re:SetValue MultiChoice Drop Box

We are sorry, but we can't really grasp what you are trying to do.The Word Document is "muddled" so the image is only half showed and the text is also behind it. When uploading try to convert to image or even better, include a small applicatio...

Product: Dataease [{8}]FIVE. Written by DataEase 04/07/16 at 08:49:31

if with getvalue setvalue

I have two virtual fields "ok" and "ok1". In the derivation of "ok1"I have "if(GetValue("KDNR") = blank, SetValue("OK","N"), SetValue("OK","J"))".That sould bee updated with "refreshform"? The Record is not saved jet....

Product: Dataease [{8}]FIVE. Written by Rainer 06/09/16 at 15:00:49

Re:if with getvalue setvalue

Yes. Depends on the derivation of the Virtual Fields and the order of the fields.If the virtual fields that are set are after the one that "manipulate" them them derivation of the virtual fields will "trump" your attempts to set t...

Product: Dataease [{8}]FIVE. Written by DataEase 07/09/16 at 08:44:18

On the blog about SetValue

New Function in 8 - SetValue() - Setting a value in any field from a button or another field (Ver. 8.0.0.1177)

The new Set functionality have now come full circle with SetValue().Traditionally DataEase functions have been limited to being just that...functions i.e. something that do a job and return the result.In DataEase 6.x we introduced a sc...

Product: Dataease [{8}]FIVE. Written by DataEase 12/12/12 at 16:28:32

Update Functionality DataEase 8 - SetValue(), SetState(), SetColor(), SetFocus() ObjectNumber Added (Ver 8.0.0.1306)

One challenge that has been present since OML was introduced and one could start to manipulate GUI object directly is to manipulate different Rows/Records in a Subform etc.Record objects in Subforms are clones, and hence don't have their own u...

Product: Dataease [{8}]FIVE. Written by DataEase 18/06/13 at 22:08:56