Default Work Order Type based on Custom Category of Service Request
Summary:
We have custom field on Service Request with values like CUST_TM, CUST_STARTUP etc. and we have Work Order Type with same values CUST_TM, CUST_STARTUP.
But I am not able to default the values selected on SR to Work order Type.
I tried the below logic -
async run(context) {
const { $page, $flow, $application, $base, $extension, $constants, $variables, $modules } = context;
const response = await Actions.callRest(context, {
endpoint: 'oracle_cx_serviceUI:serviceRequests/get_serviceRequests',
uriParams: {
'serviceRequests_Id': $base.variables.customerWorkOrders.SrNumber,
},
});
const callSetFieldValue = $modules.uiEventsFramework.setFieldValue('CustomerWorkOrder.WorkTypeCd', response.body.Categories_c, $base.variables.uefContext, false);
}
Content (please ensure you mask any confidential information):