Understand the Two sendNotification Groovy Functions

You use this first example function when there is no Notification Preferences support for for overriding messages, recipients or channels.

adf.util.sendNotification(java.lang.Object,java.util.HashMap\

Sends a notification to all enabled delivery methods. The delivery methods, message text, and recipients can be configured on the notification preferences page. If notification preferences for the trigger exist, then the values in the preferences take precedence. The first argument is the adf object. The second argument is the requestParameters HashMap, which can specify one or more of the following parameters: 'Channels', 'MessageText', 'RecipientPartyId', 'RecipientPartyIdList', 'RecipientAttributeNames'.

Example Invocation:
def map = new HashMap();
map.put("Channels",["ORA_SVC_BELL", "ORA_SVC_MOBILE"]);
map.put("MessageText","Map defaulted message"); map.put("RecipientPartyId",
AssigneeResourceId); adf.util.sendNotification(adf, map); Example Invocation
2: def map = new HashMap(); map.put("Channels",["ORA_SVC_BELL"]);
map.put("RecipientPartyIdList",[AssigneeResourceId,ReportedByPartyId]);
adf.util.sendNotification(adf, map); Example Invocation 3: def map = new
HashMap(); map.put("Channels",["ORA_SVC_BELL"]);
map.put("RecipientAttributeNames",["AssigneeResourceId",
"ReportedByPartyId"]); adf.util.sendNotification(adf, map);

The second example function is used when there's Notification Preferences support to override messages, recipients, and channels.

adf.util.sendNotification(java.lang.Object,java.lang.String,java.lang.String,java.lang.String,java.lang.Long)

Sends a push notification to all enabled channels, such as mobile or web browser bell. The channels, default messages, recipients, and other preferences can be configured on the notification rules page. A notification preference is associated with the objectCode and eventName pair. If notification preferences for the trigger exist, then the values of messageText and partyId in the preferences take precedence. The first argument is the adf object. The second argument is the eventName, which should typically match the trigger name. The third argument is the objectCode, which should typically match the business object name, for example, ServiceRequestVO. The fourth argument is the messageText. The fifth argument is the partyId.

Example Invocation:

adf.util.sendNotification(adf,'SRCritical','ServiceRequestVO','Service Request is now critical!',partyId).

Note: If you use this function and do not set up a Notification Preference, it will by default send the notification to both the bell and push channels.

Custom Objects or Fields

  1. In Application Composer , navigate to Service Request > Fields > Create a Custom Field.

  2. Navigate to Pages and include the new field in Creation Page Layout, and Details Page Layout.

  3. Write your trigger.

    Check the API Name of your new field. If you made a field called Priority, the API name will be something like Priority_c.