You’ll quickly notice that it is often necessary to update messages with additional information.
Keeping in mind future applications, you will set up a customizable form that will replace the ALERT command and display more personalized messages, where you may (or may not) authorize the copying of error messages.
Also remember that this alert dialog is a separate form. So it can contain:
several pages
a tab
buttons
arrays
as well as anything else that seems necessary.
You can even send an automatic e-mail to the Help service containing the following information:
about the user
the machine
the date
the time
the error message
and so on.
Or you can just record this information in a log file that customer service can access..
You can also set up the form so that:
you can show or hide a particular button
you can add a URL that you can click to access on-line help
you can choose the message language
you can configure messages based on a table filled in by the user
and so on.
Once you get the hang of it, the sky is the limit.
In this video, we're going to learn how to use the automatic sizing properties of objects and to understand the possible interaction between programming and interface management.
After touching up the interventions form and the table a little by adding descriptive text, comments, the % completed, an ID, and so on, we now want to include a button for sending e-mails in the detail form of the Interventions table.
This e-mail will be sent to the technician in charge of the intervention.
To do this, we need to add this button and the e-mail input interface.
We have created a MAIL project form as well as a DETAIL_FUNCTIONS method that we will call to Cancel or Validate a dialog. From the start, we plan to use this form in other circumstances.
So all the form areas will be variables that we can fill with the contents of the fields from one table or another.
Let’s make the areas auto-adjustable:
by setting the horizontal sizing to "Grow"
and by setting the vertical sizing to "Grow", only for the Content
We now need to indicate the type for these variables.
Place these lines of code in the form method:
$evt:=Form event Case of
:($evt=On Load) //Initialization of variables used in the e-mail C_TEXT(vSender;vRecipient;vCC;vBCC;vSubject;vContent) End case
This lets us initialize the variables we're going to use.
We check that the On Load event of the form is the only one checked.
The button for sending an e-mail which we'll program later come from the picture library; it's the "Mail" button that is found in the PNG files provided with the example database. The dialog box is ready. We can create, at the bottom of the Intervention DETAIL form, the button to call this dialog box. The method associated with this button is as follows:
//set a value for the variable to make input easier les variables pour faciliter la saisie vSender:="prof@4d.fr" vRecipient:=[Technicians]e-mail vCC:="" vBCC:="" vSubject:="Intervention for the "+String([Interventions]Date_Intervention)+" at "+String([Interventions]Time_Intervention) vContent:=[Interventions]Subject+(Char(13)*2)+[Interventions]Description