Default language.

Defining Service actions to replace the customized Direct SQL actions in an active link


BMC Software has replaced all out-of-the-box Direct SQL actions in active links with a service framework to avoid potential security vulnerabilities such as an SQL injection attack.

If you are using customized Direct SQL actions in the active link, replace that with Service actions.



Important

We do not recommend using custom Direct SQL actions in active links. However, if you are using a custom Direct SQL action in an active link, use the BMC provided framework and replace the Direct SQL action with a Service action.


The following video (1:25) shows an overview of replacing a Direct SQL action with a Service action.


icon_play.pnghttps://youtu.be/iJtByGhoPmE


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:

select al.resolvedname, al.overlayprop, als.fieldid, als.assignshort from actlink al, actlink_set als where al.actlinkid = als.actlinkid and als.assignShort like '107\\%'

To define a Service action

  1. In , open AR System Navigator ><server name> > All Objects > Active Links.
  2. Select the Active link that has the Direct SQL action.
  3. Right click If Actions, select Service.
  4. In Data Source, select SERVER.
  5. In the Server Name field, select the server name.
  6. In Form Name, select a form name.
  7. Perform input and output mapping.
  8. 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:

22-01-06-Example-1.png


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:

22-01-06-Example-2.png

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:

22-01-06-Example-3.png

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:

22-01-06-Example-4.png

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:

22-01-06-Example-5.png

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.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*