By default, the Type field on the General tab of the Entity Bulk Operations record is set to Rule. This indicates that the logic for the entity bulk operation is based on the rules defined on the Rules tab of that Entity Bulk Operations record.
Each Rules record applies to a field in an Entities record. The Rules tab is only available once the Entity Bulk Operations record has been saved for the first time.
This topic contains sub-topics that describe how to create a rule for a field in a top-level entity and how to create a rule for a field in a sub-type entity:
- Creating an Entity Bulk Operation Rule for Top-Level Entity Field
- Creating an Entity Bulk Operation Rule for Sub-Type Entity Field
Creating an Entity Bulk Operation Rule for Top-Level Entity Field
Follow these steps to create a rule that modifies the value of a field in the top-level entity you specified on the Entity Bulk Operation's General tab.
- Click the Rules tab on an Entity Bulk Operations record.
- Open a new Rules record from the Rules tab of the Entity Bulk Operations record.
- Select a field from the Field Name drop-down list.
- This list displays all field names from the Entity selected on the General tab of the Entity Bulk Operations record.
- Enter a description of the rule in the Comments field (optional).
- Leave Type set to Top Level.
- Select the Value Type from the list:
- Static: With this option, which is selected by default, the bulk operation updates the selected field to use the value specified in the Value field.
- Prompt: With this option, the Entity Bulk Operation wizard prompts the user to enter a new value for the selected field. The bulk operation updates the records to use the specified value.
- Formula: With this option, the bulk operation runs a specified SQL statement to obtain a new value for the selected field.
- Configure the rule's value and related fields, depending on the Value Type you selected:
- Static: Enter a static value in the Value field.
- Prompt: Enter a default value to use for this entity field (optional) in the Default Value field and a user message in the Prompt Message field.
- Formula: Enter a SQL statement that defines a new value for the specified entity field in the Formula field.
-
For example, if you want to increase a company's current credit limit by $500, use this formula:
CONVERT(int, CreditLimit + 500)
The Entity Bulk Operation code takes this formula and updates the CreditLimit field in all records in the view.
-
- Static: Enter a static value in the Value field.
- Click OK to save and close the Rules record.
- Add additional rules as needed for the entity bulk operation.
- Alternatively, you can click OK and New in Step 8 to save the current record and open a new Rules record in one step.
- Save the Entity Bulk Operations record.
Creating an Entity Bulk Operation Rule for Sub-Type Entity Field
You can create entity bulk operations that modify field values for sub-type data. For example, if you want to specify an End Date for a specific set of PersonFunctions sub-type records, you can create a rule-based Entity Bulk Operation for the Persons entity that modifies the relevant PersonFunctions sub-type records.
Follow these steps to create a rule that changes the value of a field in a sub-type entity for the entity you specified on the Entity Bulk Operation's General tab:
- Click the Rules tab on an Entity Bulk Operations record.
- Open a new Rules record from the Rules tab of the Entity Bulk Operations record.
- Set Type to Sub Type.
- The Sub Type Name and Sub Type Filter fields appear automatically at the bottom of the form.
- Enter the name of the sub-type entity in the Sub Type Name field.
- This should be a sub-type of the entity you specified in the Entity field on the Entity Bulk Operations record's General tab.
- Once the Sub Type Name field is populated, the set of fields from that sub-type entity automatically populate the Field Name drop-down list.
- Select a field from the Field Name drop-down list.
- Enter a description of the rule in the Comments field (optional).
- Select the Value Type from the list:
- Static: With this option, which is selected by default, the bulk operation updates the selected field to use the value specified in the Value field.
- Prompt: With this option, the Entity Bulk Operation wizard prompts the user to enter a new value for the selected field. The bulk operation updates the records to use the specified value.
- Formula: With this option, the bulk operation runs a specified SQL statement to obtain a new value for the selected field.
- Configure the rule's value and related fields, depending on the Value Type you selected:
- Static: Enter a static value in the Value field.
- Prompt: Enter a default value to use for this entity field (optional) in the Default Value field and a user message in the Prompt Message field.
- Formula: Enter a SQL statement that defines a new value for the specified entity field in the Formula field.
- If needed, specify a valid WHERE clause in the Sub Type Filter field to target the value change to a specific set of sub-type records.
- Do not enter the word WHERE in the filter statement. The system appends this keyword automatically.
- In the example below, the rule only modifies PersonFunctions sub-type records where the FunctionID is 8.
- Click OK to save and close the Rules record.
- Add additional rules as needed for the entity bulk operation.
- Alternatively, you can click OK and New in Step 10 to save the current record and open a new Rules record in one step.
- Save the Entity Bulk Operations record.
Comments
Please sign in to leave a comment.