Previous Next JavaScript must be enabled to correctly display this content

## 9.4 JS Changes

This topic provides the systematic instructions to JS fields.

Perform the following steps to implement JS changes:

1. Add all the dependencies in define block.
2. The JS self.payload is an observable, which will hold all the info inputted from the HTML. All keys in self.payload is directly linked with HTML.

   Figure 9-8 JS Changes

   Description of "Figure 9-8 JS Changes"

   Figure 9-9 JS Self Payload

   Description of "Figure 9-9 JS Self Payload"
3. Save method implementation will look like in below figure. In the next line, it is making a promise and calling the save function of cmn-ct-datasegment providing the payload and endpoint as parameters. If save is success, it will resolve and for failures it will come to reject.

   Figure 9-10 Save Method

   Description of "Figure 9-10 Save Method"
4. The function null check is as shown below:

   Figure 9-11 Function Null Check

   Description of "Figure 9-11 Function Null Check"
5. The validate function is shown in the below mentioned validate function screen, which will check all mandatory fields during save.

   Figure 9-12 Validate Function

   Description of "Figure 9-12 Validate Function"

Parent topic: Extensibility Use Cases for OBX