How to Work Directly with the Database - Stored Procedures
Required Permissions
This section requires the Application Designer permission from your Domain's administrator.
Check What are the Design Tasks? to learn more about permissions to work with Design Mode and other tools.
Learn how to embed Stored Procedures in your eLegere application as a Custom Action.
Warning
This section is dedicated to administrators and who works directly with the eLegere's database. This section assumes that you know what are the Stored Procedures.
Info
This section explains only how to configure a Stored Procedures Custom Action, not the details about how Stored Procedure work in eLegere. For more information about how Stored Procedures work in eLegere, check Stored Procedures in the Developer Guide.
Under certain scenarios, the Designer has to interact with the eLegere database directly. In these cases, Designers can configure a Stored Procedures as Custom Actions. When launched, Stored Procedures Custom Action execute operations on the eLegere database without passing through the service.
Follow the steps below to create a Stored Procedure Custom Action.
-
In Design Mode, click on the icon in the upper-right corner of any panel.
The action leads to the Custom Actions panel.
-
Click on the Enable Module toggle switch to activate the Custom Actions in your application.
-
Click on the New Action drop-down menu button.
-
Choose the Invoke Stored Procedure type from the list of Custom Actions types. This action creates a Stored Procedure Custom Action.
This action creates the Stored Procedure Custom Action to be configured.
-
Insert in the Info section the required information
- (1) Name Insert a name for the Stored Procedure Custom Action.
- (2) Description
optional
Insert a description for the Stored Procedure Custom Action. - (3) Manual If enabled, the Users launch this Custom Action manually. If disabled, choose at (4) Event a triggering condition to launch the Custom Action. (By default, the toggle switch is enabled.)
- (4) Event If (3) Manual is disabled, choose a trigger condition from the drop-down list.
Event - Triggering Options
For the Event option, when the Manual toggle-switch is disabled, choose a moment when the Custom Action runs.
PRE ROW INSERT Before inserting a row.
POST ROW INSERT After a row's insertion.
PRE ROW UPDATE Before any changes apply to a row.
POST ROW UPDATE After having edited a row.
PRE ROW DELETE Before deleting a row.
POST ROW DELETE After having deleted the row.
PRE ATTACHMENT INSERT Before uploading an attachment to a row.
POST ATTACHMENT INSERT After having uploaded an attachment to a row.
POST MASTER INSERT After having inserted a row on the Master table.
POST MASTER UPDATE After having saved an edited row on the Master table.
POST MASTER DELETE After having deleted a row on the Master table.
If your Stored Procedure manages attachments: check the Stored Procedures section in Developer Guide for learn more technical details about PRE ATTACHMENT INSERT and POST ATTACHMENT INSERT triggers' behavior while uploading attachments.
- (5) Async Enable to run the Custom Action in the background instead of waiting for its completition to use the application. (By default, the Async toggle-switch is enabled when (3) Manual is enabled. Otherwise, the toggle-switch is disabled.)
- (6) Execution
optional
Click to open the Formula Editor. Insert a Formula to define the conditions for executing the Custom Action. - (7) Visibility
optional
Click to open the Formula Editor. Insert a Formula to define the conditions to display the Custom Action in the application. - (8) Refresh
optional
If enabled, the application refreshes the data on the table when the Custom Action has finished to run. - (9) Icon
optional
Choose an icon for the Custom Action. - (10) Context Decide if the User launches the Custom Action from the Custom Actions drop-down menu in the application or from the Row's Options (). Disabled if (3) Manual is disabled.
- (11) Table Choose the table where the Custom Action runs.
-
In the Parameters section, choose the settings for the Stored Procedure.
- (1) Insert the Stored Procedure's name on the database.
- (2) Click on New to define a value for a key in the Stored Procedure
- (3) Click on the Reset button to clear all the values and keys from the Parameters section.
Info
Stored Procedures written with eLegere in mind require specific deafult parameters.
Check the Stored Procedures section in the Developer Guide for more information how to write a Stored Procedure for eLegere.
Clicking on New inserts additional parameters to be passed to the Stored Procedure besides eLegere's mandatory parameters. Insert in the line the key (i.e. the defined parameter in the Stored Procedute) and the value from the application to be passed to the Stored Procedure.
-
This step is optional. Follow this step if you want to block the use of one application while the Stored Procedure Custom Action is running.
In the Application Lock, click on the Enabled toggle switch to enable the application's locking. (By default, Enabled is turned OFF.)
Choose one application from the drop-down list to lock while the Custom Action is running.
-
When you have completed the configuration, click on the Save button () in the top-left corner to save the Stored Procedure Custom Action.
Success
You have configured a Stored Procedure on the database as Custom Action.
Tip
If you want to disable the Stored Procedure Custom Action without deleting it from the Application, click on the toggle switch next to the Custom Action's name to hide it from the users.