For this tutorial the LightCRM (X Evolution 2) sample will be used to exercise the use of Control Value Change Event.
The objective is that the insertion of the data of a Contact in this app should be done progressively, only when you completed the previous data the next inputs are going to appear.
On the object WorkWithDevicesContact Section General Edit layout, set the property visible to false for the following controls.
Table2, Table3, ContactEmail, CompanyName.
After adding the ContactName automatically the ContactEmail will appear and after completing the ContactEmail the CompanyName attribute will appear.
Program the following events:
&isEmpty = IsEmpty(ContactName)
Msg("You have to complete the Contact Name to continue")
Table2.Visible = 1
ContactEmail.Visible = 1
&isEmpty = IsEmpty(ContactEmail)
Msg("A Complete email is required to continue")
Table3.Visible = 1
CompanyName.Visible = 1
The IsEmpty Procedure has the following source:
&bollIsEmpty = true
&bollIsEmpty = false
parm(in: &varChar, out: &bollIsEmpty);
Done! The example can be accessed from LightCRM (X Evolution 2).
The user is forced to enter a Name and Email to be able to complete all the form of the Contact. This is one of the many scenarios in which the Control Value Changed Event can be used.