You will learn how to patch the document with the ID Orders/A655302
using a patching script that combines the JavaScript and parameters.
In the Management Studio, select the
Orders
database to be the current database and click on the Patch tab to show the Patch screen.In the Patch type list, select the Document type.
In the Document to patch textbox, enter
Orders/A655302
, which is the ID of the document we want to patch, and press Enter.Click on the Add new Parameter button (the green plus sign to the right of the Parameters section) to add a new parameter.
Enter
ItemName
for the Name andInk Pen
for the Value.In the Patch Scripts zone, enter the following JavaScript code snippet:
this.UnitCost = this.UnitCost * 1.15 this.Item = ItemName
Click on the Test button to test the patch script on the selected document.
Observe the changes in the After Patch section and verify that the document has new fields value.