NumRecords Action will allow the user to fetch the number of records from the Local database as per the query given.
Note: No. of records is saved in a GLOBAL Variable named "__NUMREC__".
Step 1: Open a Free Layout Page.
a. Drag a TextField and a RoundButton UI part and drop it on the Page.
b. Set the Title/Display text of TextField as "__NUMREC__" as shown in the image.
c. Browse to the "Functions" section on "Properties Palette window" of RoundButton for applying actions.
d. Click on the corresponding Edit(0) button of the Function on which user wants to apply the Action. To know more about the Functions click here.
Step 2: Click on "Add" button on the Actions window to add an action. To know more about actions click here.
Step 3: Select the Actions category as “Local DB Control”.
Step 4: Click on the "Local DB Control" and then click on “NumRecords” action.
Click here to know about "Doc" Button.
Step 5: Enter Action Parameters:-
Parameter |
Description |
Service Name |
Select the service Name as "localDb". |
Table Name |
Select the Table name for e,g "emp". |
Where |
Enter the where parameter to delete a specific record. The syntax of where condition is same as SQL i.e Columnname='data'. Columnname is the name of the table field from the database and data is any entry which is mentioned in that field of database. For e.g empcity = 'Tokyo'.
Note: Please note that the user can use variables or TextField name within square brackets also. (For e.g: Columnname = '[TextField_1]' ) Click here for more Examples. |
Step 6: Action is applied as shown in first image below. Click on "+" Action Event Button on the right to apply Action on success of the above action. "success" and "Error" events are visible as shown in second image below.
Success : If number of records fetched is 0 or more, only then On Success sub-actions will trigger.
Error : If there is error on server side and no record is fetched (not even 0) as an output using NumRecord Action, then On Error Sub-Action will trigger.
Step 7: Select Success event and click on "Add" button to apply action. Select the Actions category as “Main Value”, click on "Reload the Updated Data" action. Enter Action Parameters as below and click "Apply".
Parameter |
Description |
Target Page |
Select the Target page for the page to be Reloaded. |
Step 8: Action On Success is added as shown in below images. Click on "OK".
Step 9: Preview the Page. Click on "No. of Records" Round Button. The No. of Records fetched based on the query is displayed in the TextField as shown in the preview.