Defining Service actions to replace the customized Direct SQL actions in an active link
The following video (1:25) shows an overview of replacing a Direct SQL action with a Service action.
Before you begin
Use the SQL query to obtain the list of active links that include Direct SQL actions. Before running the query, ensure that you have access to the database.
For example, a database administrator runs the following query on the database to obtain a list of Direct SQL action active links:
To define a Service action
- In , open AR System Navigator ><server name> > All Objects > Active Links.
- Select the Active link that has the Direct SQL action.
- Right click If Actions, select Service.
- In Data Source, select SERVER.
- In the Server Name field, select the server name.
- In Form Name, select a form name.
- Perform input and output mapping.
- Save the Service action.
Examples of defining Service actions
The following examples show how to perform different tasks by defining a Service action.
Example 1: Service action to obtain AR Schema details, such as Schema ID and Next ID, based on the schema name from the arschema table
The following screenshot shows input and output mapping to obtain the AR Schema details:
Use the GETSCHEMA service key to return the Schema ID and Next ID based on the schema name.
The following table describes the details about input and output mapping:
Value | Method | Parameter name | Description |
---|---|---|---|
GETSCHEMA | Input | Input_ServiceKey | A mandatory input to trigger the service. Returns Schema ID and Next ID based on the input schema name Input_SchemaName. |
Input_SchemaName | A mandatory input to trigger the service. Passes the schema name as dynamic or hardcoded value. | ||
Output | Output_SchemaId | Returns the Schema ID. | |
Output_SchemaNextId | Returns the Next ID. |
Example 2: Service action to obtain record count based on the input qualification for a form
The following screenshot shows input and output mapping to obtain the record count of a form:
Use GETSCHEMACOUNT service key to obtain the record count of any form based on the input form name or form view name, and input qualifications.
You must provide either the Input_SchemaName or Input_SchemaViewName parameter. You can convert Count(*) or count(<fieldname>) to this service key.
The following table describes the details about input and output mapping:
Value | Method | Parameter name | Description |
---|---|---|---|
GETSCHEMACOUNT | Input | Input_ServiceKey | A mandatory input to trigger the service. Returns the Record Count based on other input parameters. |
Input_SchemaName | Pass the schema name as dynamic or hardcoded value. | ||
Input_SchemaViewName | Pass the schema view name as dynamic or hardcoded value. | ||
Input_SchemaId | Pass the schema ID as dynamic or hardcoded value. | ||
Input_SchemaFieldName | Field to obtain the count. | ||
Input_AdditionalQual | Define the qualification criteria. | ||
Output | Output_SchemaCount | Shows the record count result. |
Example 3: Service action to obtain field details based on the input Field ID, Field name, and additional qualification for a form
The following screenshot shows the input and output mapping to obtain the details:
Use the GETSCHEMAFIELD service key to obtain details such as Field ID, Field name, Default value, and Data type, based on the input qualification and field name.
The following table describes the details about input and output mapping:
Value | Method | Parameter name | Description |
---|---|---|---|
GETSCHEMAFIELD | Input | Input_ServiceKey | A mandatory input to trigger the service. Returns the details about the form field based on other input parameters. |
Input_SchemaFieldId | Pass the schema field ID as dynamic or hardcoded value. | ||
Input_SchemaFieldName | Pass the schema field name as dynamic or hardcoded value. | ||
Input_SchemaId | Pass the schema ID as dynamic or hardcoded value. | ||
Output | Output_SchemaFieldName | Form field name. | |
SchemaFieldId | Field ID. | ||
Output_SchemaFieldDefaultValue | Default value of the field. | ||
Output_SchemaFieldDatatype | Field data type. |
Example 4: Service action to obtain the Field ENUM ID and value based on the input Field ENUM value, field name, and additional qualification for a form field
The following screenshot shows the input and output mapping to obtain the details:
Use the GETENUMID service key to obtain details about the Field ENUM ID based on the input qualification and Field Name.
You must provide the Input_FieldEnumValue parameter.
The following table describes the details about input and output mapping:
Value | Method | Parameter name | Description |
---|---|---|---|
GETENUMID | Input | Input_ServiceKey | A mandatory input to trigger the service. Returns the details about Field Enum ID details based on other input parameters. |
Input_FieldEnumValue | Pass the Set Field ENUM value as an input. | ||
Input_SchemaFieldId | Pass the schema Field ID as dynamic or hardcoded value as an input. | ||
Input_SchemaFieldName | Pass the schema Field Name as dynamic or hardcoded value. | ||
Input_SchemaName | Pass the schema Name as dynamic or hardcoded value. | ||
Output | Output_FieldEnumId | The Form Field Enum ID. | |
Output_FieldEnumValue | The Form Field Enum Value. |
Example 5: Service action to obtain the information from the schema_sort table based on the additional qualifications for a form
The following screenshot shows the input and output mapping to obtain the details:
Use the GETSCHEMASORT service key to obtain details about form sorting such as listIndex and sortOrder from the schema_sort table based on input qualification.
You must provide the Input_AdditionalQual parameter.
The following table describes the details about input and output mapping:
Value | Method | Parameter name | Description |
---|---|---|---|
GETSCHEMASORT | Input | Input_ServiceKey | A mandatory input to trigger the service. Returns the details about list index and sort order based on other input parameters. |
Input_AdditionalQual | Enter the qualification criteria. | ||
Output | Output_Sort_SortOrder | Enter the form sort order. | |
Output_Sort_ListIndex | Enter the form sort list index. |