Overview
This guide provides step-by-step instructions for setting a default Channel Type during Service Request (SR) creation in Fusion Service Center, using Visual Builder Studio and UI Events Framework (UEF).
We can set the default channel type during SR creation. Users can change it anytime when editing the SR, unless you make it read-only to ensure they won’t alter your desired default.
The extension we will build here provides the below results.
Adding the Channel Type to SR Create layout.
- In VB Studio, navigate to layouts and select ServiceRequests > Create Service Request.
- Add Channel Type to the layout.
Defaulting Channel Type
- In VB Studio, navigate to Service > ec > sr > create page
- Navigate to “Event Listener” and create a vbEnterListener
- Drill into the create action chain. Change the view mode from Design to Code.
- This option is available in the top right corner
- Add the following UEF Code and modify the channel type according to your customer’s preference.
- Starting with version 24D, you won’t need to use JavaScript, as we’ve introduced the CX Service Action to set field values
- more information >> Introducing CX Service Actions: Streamlining Automations with Enhanced Save, Get Field(s), and Set Field(s).
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
let tabContext = await frameworkProvider.getTabContext();
const recordContext = await tabContext.getActiveRecord();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('cxEventBusSetFieldValueOperation');
requestObject.field().setValue('ServiceRequest.ChannelTypeCd', 'ORA_SVC_CHAT');
recordContext.publish(requestObject).then((message) => {
// custom code
}).catch((error) => {
// custom code
});
- Preview, Test it and Publish as needed.
