DataEase 8 - Button Actions/Executing Multiple Actions/Scripts (Ver. 8.0.0.1257)
A lot of users "under use" their DataEase for Windows, and it will be part of our goal over the next months to try to get our users to get more out of their DataEase.
The "under use" is a lot down to missing or bad documentation (we will work hard to rectify this too), but also due to being stuck in a rut, and misunderstanding the functionality (some times with our help....)
One of the most common misunderstandings are related to the Button Action: Execute CDF.
We are firstly glad to inform that it doesn't exist more as it has been replaced with the Action: Execute Function/Derivation.
I say replaced, but in reality simply renamed.
Execute CDF could always do much more than executing a CDF, so why it was called this in the first place is a mystery. What is for sure though, is that it has prevented a lot of users from ever using it.
This Action is simply the singularly most useful of all the actions and in fact it can replace all of the other ones as this is where you can write your own script/derivation.
On this action the only rule that applies is the same one that apply in a normal field derivation - it have to be allowed/correct.
You can combine any functions in the DataEase lexicon, and as the return value is of no importance you can concentrate on simply getting them fired in the right order (which can in fact be a challenge..)
RecordSave( )+MemoCopy(Attachments,concat(GetFileName("","",GetCurrent("MyDocuments")),","),0) +RecordSave( )
Is a Execute CDF "derivation" from our Advanced Email example.
It simply saves the record, Copies the return value of the GetFileName function into the field Attachement with append option, and then save the record again.
SetValue("Picture",GetFileName("","",GetCurrent("MyDocuments")))
This little darling finds the file name of an image and then set the value into a ImageField called Picture where it is previewed.
You can of course also use our new and exciting ExecDQL() to run a series of scripts directly from the button, interpreted and manipulated.
Wait() is also a function you might want to look into as it basically insures that your functions are not executed until a certain amount of time is passed (in seconds).