Add a Fusion Service Field to the Service Request Page
There several steps you perform to add a custom field from Fusion Service into the Service Request form.
-
Replace the service metadata: You first replace the service metadata in Digital Customer Service with the latest metadata from Fusion Service, including the configurations you would like the Digital Customer Service application to consume.
-
Edit the page itself. You add the new field, change the REST API call to ensure that the new field is requested or sent, and then you add a new UI control for the new field onto the page.
Replace the Metadata
Replace the endpoint metadata in the application with the latest metadata from the server that includes the new configuration.
-
In Visual Builder select the crmRestApi in the Services window, and then click the Service Connections icon in the navigator.
-
Click the Endpoints tab.
-
Click the Replace definitions for all selected endpoints icon.
-
Click Replace on the Confirm definitions replace dialog box.
-
Once the operation is complete, click OK.
Add the New Field
Now you add the new field to the corresponding type in the Digital Customer Service application
-
In the navigator, click the Web Application icon.
-
Expand the Flows node.
-
Expand the service-request-create flow.
-
Select service-request-create-start.
-
From the Designer list, select the Variables and Types icon.
-
In the workspace, for the createServiceRequest type, click Edit from Endpoint .
-
From the Endpoint Structure list, select the custom field, and then click Finish.
Change the REST Request
Change the action chain for the REST request to ensure that the field is included in the body of the create request and mapped to the property on the object.
-
Ensure that the service-request-create-start is selected, and then from the Designer list, select the Actions icon.
-
In the workspace, select SubmitServiceRequestAction.
-
In the workspace, select the callCreateServiceRequestEndPoint REST call.
-
In the Call Action Chain window, in the Input Parameters area, click Assign.
-
In the Call Action Chain workspace, in the Target area, click body.
-
Before the closing brace in the JSON code, add a new entry for the custom field. Make sure you add a trailing comma to the preceding line.
For example,
"MyCustomField_c": [[ $page.variables.serviceRequest.MyCustomField_c ]]
Change the GET REST Request for the List
Edit the action chain or service data provider that does the GET request and make sure the field parameter of the GET includes the custom field. You also may need to map the field in the response to a variable.
-
In the Web Apps list, expand the Flows node, and then expand the service-request-list node.
-
Select service-request-list-start
-
In the Designer, click the Variables and Types icon.
-
In the Variables workspace, select srListServiceDataProvider.
-
In the Parameters list, select the fields parameter.
-
In the urlParameters.field area, add a comma at the end of the field list, and add the Fusion Service custom field name, then click Save.
Change the GET REST Request for the Detail Page
Now edit the request for the detail page.
-
From the Flows list, expand the service-request-detail node, and then select service-request-detail-start.
-
Click the Actions icon in the Designer.
-
Locate LoadServiceRequestAction, and click the Menu icon in that row, and select Edit.
-
In the diagram, click Call REST Endpoint.
-
In the Input Parameters list, select fields.
-
Add the new custom field to the comma separated list of fields and then click Save.