Agile Developer

Events

Axpert 11
TStructs (Forms)
IViews
Scripts
Axpert Jobs
Axpert Cards
HTML Plug-ins
Users & Roles
Workflow
Axpert API
Application Var/Params
Publish Axpert Apps
Axpert Mobile
Settings
Utilities
Customization
WebServices

Events in a form

An event is an occurrence of an action that can be triggered or generated by the system. To trigger events in Axpert use the form load check box available in the scripts.

Form Control Enabled

We have the following options when the form control is selected.

caption

Create a Script with a suitable name and enable form control by selecting the check box
1. Choose ‘On Data Load’ from the dropdown

caption

In the above image, the script includes a function to disable control on fields of dc1 in department master. Go to the run site, find the department master form, and open the List view. Try loading details of one row by clicking on it. This will display the fields of dc1 which are disabled in the form.

caption

2. Choose ‘On Form Load’ from the dropdown.

captionThe image includes a script to hide the fields of dc1 in the department master. Go to the run site and load the form. Only the dc2 fields should be displayed like the image shown below.

 

caption

3. Choose ‘On Field Enter’ from the dropdown.

captionThe above image includes a script to hide the experience field when the name from dc2 is ‘syamala’. Otherwise, the experience field is disabled.
condition 1 – if name={syamala}
AxHideControls({exp})

caption

condition 2 – else
AxDisableControls({exp})
end

caption

4. Choose ‘On Field Exit’ from the dropdown

caption

Condition 1- if age < eage
AxHideControls({dc1})

caption

Condition 2 – elseif age > eage
AxDisableControls({dc1})

caption

5. Choose ‘On Click’ from the dropdown.

caption

On click of gname field in the run site, the exp field should be hidden or disabled based on the conditions.

Form Control disabled

When form control has not been enabled the options available are shown below

caption

1. Click on ‘Before Save Transaction’ from the dropdown.
In the table named ‘stud’, currently, there are three entries.

caption

Write a script to insert a name

caption

Create a button for ‘Before save’ using the option available in Toolbar.

caption

Navigate to the run site and insert a value into the table, click on the ‘Before save’ button without submitting the entered value.

caption

The value entered should reflect in the ‘stud’ table as shown

caption

2. Click on ‘After Save Transaction’ from the dropdown.
Write a script to insert a name into the ‘stud’ table and choose ‘After Save transaction’ from the dropdown.

caption

The value ‘pqrs’ should reflect in the stud table after submission.
3. Click on ‘Before Delete Transaction’ from the dropdown.
Write a script to delete a name from the table, and create a button ‘Before Delete’ using the option available in the toolbar.

caption

Check the entries in the SQL window to verify the deletion.

4. Click on ‘ Before Cancel Transaction’ from the dropdown.
When you want to perform an action before canceling the transaction, which will reflect the changes only in the SQL table. Write a script to cancel a transaction from the table, and create a button using the option available in the toolbar.

caption

Workflow related Events

To enable workflow-related events, Create a form and create related user roles and responsibilities.

1. Click on ‘On Create’ from the dropdown.

Write a script to insert the value into the stud table and execute it on the run site.

caption

Enter the value and save it to successfully create a workflow.

caption

Verify insertion of the value from the SQL window.

caption

2. Click on ‘ On approve’ from the dropdown.

Write a script to insert the value into the table after approval from the manager.

Ex: firesql({qa},{insert into stud(ename) values(:name)})

Then got to the run site and enter a value in the form, go to list view, and find the value which is directed for approval from the manager.

caption

Log in as manager and approve the transaction.

caption

The value should be inserted into the stud table as shown.

caption