Create an Alert box

Here are the steps that needs to be taken to create an Alert Message box:

Step 1- Go to X/E Files > X/E Master Files > Messages, Create an alert message record providing the error code name, language, type and message.

Defining properties of the Alert box
Figure: Defining properties of the Alert box
  • Select the type of message box based on requirement. Here we have created the Message box of type Information with message error code ‘testinfo‘ for demonstration purpose.

Step 2- Go to composer, Create a new program

  • In the tab Event (or any other appropriate event), create an event and define a procedure based on the requirement
  • Write the logic for Alert box in Program file(.p) for the particular event procedure and mention that procedure in Procedure
  • Mention the Program file in Run
  • In this .p code file mention the name of error code that is created in step 1 with the following syntax p-error = [xerrc]. {xerrc is the error code that we define in the messages.}
  • Save and close the Program
  • We have created a CHOOSE event for button ‘v-testbtn’ for demonstration as shown in image below:

In the procedure (p-choose) contained by file (c/custlord.p) we may customize the logic for the Alert box as shown below:

{x/xxxxlparam.i}

procedure p-choose:
/*------------------------------------------------------------------------------
Field: v-testbtn
Event: CHOOSE

Description :
Created : 16/12/12 Javra Software
------------------------------------------------------------------------------*/

assign
p-error = 'testinfo'.

end procedure. /* p-choose */

Step 3 - Trigger the event that runs the logic for alert box.
Here, the alert box will pop-up on clicking the ‘v-testbtn’ button named ‘Test’ as shown below:

For alert box of type Message, Information, Error and Warning we use:

p-error = “[xerrc]”. where xerrc is the error code.

For alert box of type Question, we use:

p-action = “xe-dialog” + chr(2) + “” + chr(2) + “[xerrc] “.
See the next section for detail explaination on Alert box of Question type.

results matching ""

    No results matching ""