Send Internal Note
This is sample code to trigger a notification to be sent to a recipient when an new SR message of type Internal Note is created.
You can copy and paste this sample code in Application Composer > Objects > Standard
Objects > Service Request > Message > Server
Scripts.
/* DISCLAIMER: This trigger is provided only as a reference.
* TRIGGER TYPE: Before Insert to Database
* OBJECT: Message (child of Service Request)
* Use Case: Send an internal notification to the user when an SR message is created.
*/
if(MessageTypeCd == 'ORA_SVC_INTERNAL_NOTE')
{
try{
def map = new HashMap();
map.put("Channels",["ORA_SVC_BELL", "ORA_SVC_EMAIL"]);
map.put("MessageText","Internal Note message");
map.put("RecipientPartyId", ServiceRequest?.AssigneeResourceId);
map.put("ObjectCode", 'ServiceRequestVO');
map.put("ObjectId", SrId);
adf.util.sendNotification(adf, map);
}
catch (e) {
throw new oracle.jbo.ValidationException('Failure: ' +
e.getMessage())
}
}