How can I automatically update service or help desk request status after a customer response?
You create a trigger in Application Composer on the Message child object of either the Service Request parent object or the HR Help Desk Request object
Here's how:
- Create a new sandbox or open an existing one. From the sandbox Tools menu, select Application Composer.
- In the object panel, expand Standard objects, then HR Help Desk Request (or Service Request), then the Message child object, and then select Server Scripts.
- Click the Triggers tab, then click Add a new Trigger.
- From the Trigger drop-down list, select Before Insert in Database.
- Enter an error message in case the validation fails.
- In the Trigger Definition field, paste the following Groovy script:Note: Change CUST_REPOND in the script to your own status value.
def parentSR = ServiceRequest def msgSource = SourceCd def msgChannel = ChannelTypeCd def parentStatus = ServiceRequest?.StatusCd def msgType = MessageTypeCd if (msgSource =='ORA_SVC_INBOUND_MSG' && msgChannel =='ORA_SVC_EMAIL' && msgType == 'ORA_SVC_CUSTOMER_ENTRY' && ParentMessageId !=null) parentSR.setAttribute('StatusCd', 'CUST_RESPOND')
- Click Save and Close.