WorkflowRuleSetUpsert
Updates existing workflow rule configuration data or inserts new data. The Manage Workflow Rules privilege is required (to create workflow rules for the User record type, the Manage Workflow Rules for User privilege is also required). Additionally, the Workflow Cancel Save privilege is required if the Cancel save setting is to be updated or inserted.
Usage
Use the WorkflowRuleSetUpsert method to update or insert workflow rule configuration data. The Manage Workflow Rules privilege is required.
The apData:WorkflowRuleSet argument has the following child elements:
RecordType. The record type (required).
TriggerEvent. The event that triggers the workflow rule (required). The possible values and the associated trigger events are as follows:
Trigger Event | TriggerEvent LIC |
---|---|
When New Record Saved |
WriteRecordNew |
When Modified Record Saved |
WriteRecordUpdated |
Before Modified Record Saved |
PreWriteRecord |
Before Record Is Deleted |
PreDeleteRecord |
After Association With Parent |
Associate |
After Dissociation From Parent |
Dissociate |
When Record Is restored |
RestoreRecord |
When Records are merged |
MergeRecords |
Scheduled Event |
ScheduledEvent |
ParentRecordType. The parent record type. This is specified if the trigger event is After Association With Parent or After Dissociation From Parent. These trigger events are supported only for the Account, Contact, and Opportunity record types.
ListOfWorkflowRules. The list of workflow rules for the record type and trigger event. Each <WorkflowRule> element has the following child elements:
WorkflowName. The name of the workflow rule (required). This name is used to reference an associated workflow action set.
Active. Whether the workflow rule is enabled or disabled.
Exit. Whether exiting a workflow in a sequence of workflows is enabled. If the condition on the rule is met, the active actions on the workflow rule are performed. However, none of the subsequent workflow rules that are based on the same record type and the same trigger event, and where applicable, the same parent record type, are triggered.
Note: For workflow rules where <TriggerEvent> has the value ScheduledEvent, the <Exit> element is always set to true and is read-only.Description. A description of the workflow rule.
WorkflowRuleCondition. The condition for the workflow rule.
Note: You cannot specify a condition for a workflow rule that has the Scheduled Event trigger event. If the <WorkflowRuleCondition> element is populated when you insert or update a workflow rule that has the Scheduled Event trigger event, then the element is ignored.CancelSave. Whether Cancel Save processing is performed, if the condition is not met.
Order. The order number for the workflow rule. The order number determines the order in which Oracle CRM On Demand invokes a sequence of workflow rules that are based on the same record type and the same trigger event, and if applicable, on the same parent record type.
Note: The <Order> element is read-only for workflow rules that have the Scheduled Event trigger event because such workflow rules are not performd as part of a sequence.DisplayMessage. The message returned if the condition is met, and if cancel save processing is performed.
ListOfWorkFlowTranslations. Translations in the languages activated for your company of the display messages that are returned if the condition on a rule is not met and the save operation is canceled. Each <WorkflowTranslation> element has the following child elements:
LanguageCode. The three-letter language code for the language.
DisplayMessageTranslation. The translation in the language identified by the language code.
The following child elements of <WokflowRule> are applicable for the Scheduled Event trigger event only:
StartDateTime. The date and time for the first instance of the scheduled event to be executed.
EndDateTime. The date and time after which no further instances of the scheduled event are to be executed.You must specify a value for either EndDateTime or NumOccurrence.
RecurrenceType. The type of recurrence (required). Valid values are: Hourly, Daily, Weekly, Monthly, Yearly.
RecurrencePeriod. An integer corresponding to the value of the Every field in the UI. For example, if the value is 2 and <RecurrenceType> has the value Monthly, the scheduled event occurs every 2 months.
LastDayOfMonth. Whether the event occurs on the last day of the month. This value is only applicable if <RecurrenceType> has the value Monthly.
NumOccurrence. A number of occurrences for the schedule event. This value is only applicable if a value for <EndDateTime> is not specified.
ListName. The name of the filtered list that returns the records on which you want the workflow actions to act. Corresponds to the UI field: Execute rule for records matching the conditions of the list. If the list has the same name as other lists to which the user has access in a target environment, the scheduled events will run against the most personalized of those lists after migration to the new environment.
ScheduledInstancesInitiatedByUser. The user ID of the user who initiates the workflow rule. This is the ID of the user who was the last person to modify the scheduled event through the user interface and not necessarily the user who is migrating workflow rules. Corresponds to the UI field: Initiated By. This element is read-only.
ScheduledEventStatus. The status of the scheduled event. Possible values are: Not Scheduled, Scheduled, Terminated, Completed. This element is read-only.
EnableNotification. Whether email notifications are sent is sent to the user who last modified the scheduled event before the instance of the event is generated. If the value is true, an email is sent when any of the following happens:
An instance of the scheduled event completes successfully.
An instance of the scheduled event fails.
An instance of the scheduled event is deleted from the Workflow Wait Monitor.
For more information about workflow rules, see Oracle CRM On Demand Online Help.
Arguments
The following table describes the arguments taken by the WorkflowRuleSetUpsert method.
Name | Description | Required | Default | I/O |
---|---|---|---|---|
apData:WorkflowRuleSet |
The workflow rule data to be updated or inserted. |
Yes |
Not applicable |
Input |
Status |
The status of the call. |
Not applicable |
Not applicable |
Output |
Return Value of the Call
The status is returned.