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.

  1. In Visual Builder select the crmRestApi in the Services window, and then click the Service Connections icon in the navigator.

  2. Click the Endpoints tab.

  3. Click the Replace definitions for all selected endpoints icon.

  4. Click Replace on the Confirm definitions replace dialog box.

  5. 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

  1. In the navigator, click the Web Application icon.

  2. Expand the Flows node.

  3. Expand the service-request-create flow.

  4. Select service-request-create-start.

  5. From the Designer list, select the Variables and Types icon.

  6. In the workspace, for the createServiceRequest type, click Edit from Endpoint .

  7. 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.

  1. Ensure that the service-request-create-start is selected, and then from the Designer list, select the Actions icon.

  2. In the workspace, select SubmitServiceRequestAction.

  3. In the workspace, select the callCreateServiceRequestEndPoint REST call.

  4. In the Call Action Chain window, in the Input Parameters area, click Assign.

  5. In the Call Action Chain workspace, in the Target area, click body.

  6. 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.

  1. In the Web Apps list, expand the Flows node, and then expand the service-request-list node.

  2. Select service-request-list-start

  3. In the Designer, click the Variables and Types icon.

  4. In the Variables workspace, select srListServiceDataProvider.

  5. In the Parameters list, select the fields parameter.

  6. 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.

  1. From the Flows list, expand the service-request-detail node, and then select service-request-detail-start.

  2. Click the Actions icon in the Designer.

  3. Locate LoadServiceRequestAction, and click the Menu icon in that row, and select Edit.

  4. In the diagram, click Call REST Endpoint.

  5. In the Input Parameters list, select fields.

  6. Add the new custom field to the comma separated list of fields and then click Save.