Customer Form Mode
Click on the Database Forms tab. The Customers database has two Forms available for configuration - the two Forms that were created from Postman. In this part,the Customer form will be configured for two different access settings.
Default Mode
- Click on the Customer Form. You will be prompted that it will be configured as default, select Yes. Click to open the Customer form access mode.
- The Form configuration opens with the default mode open.
- Hover and click the
+
sign against each of the following fields to enable them for read/write access:name
category
address1
address2
city
state
zipCode
website
- The page should look like this: The circled area is the main area where we configure the fields we have added.
- Click on the
+
sign againststatus
. Then select that field in the main area and change Read/Write to Read Only. - In the Formula for Write Access type
status = ""
. This will prevent write access if given status in a PUT/POST request is not blank. - In the On Save Formula box type
@SetField("status";"Active")
. This will set thestatus
field to beActive
for new documents. - Click on the Save button at the top of the default Form Access Mode.
Update Mode
- Click on the + Add Mode button.
- Enter
update
as the mode name for the new mode and click Save. - Click the
+
sign against all fields to add them. - Scroll down to the Formula for Delete Access. Change
@False
tostatus = "Inactive"
. This ensures that the customer will not be deleted if customer status is notInactive
when using theupdate
mode. - Click on the Save button at the top of the Form Access Mode.
The Formula for Write Access could be used to ensure only certain options are allowed for the status
field. Try ensuring only Active
and Inactive
are allowed.
Congratulations!
This has:
- Configured the Customer form for Domino REST API access.
- Ensured the
status
field cannot be set in REST API requests for new documents, but is always set toActive
. - Ensured the default Form Access Mode can be used to read documents at any time, but can only be used to create new documents.
- Enabled the
update
Form Access Mode for updating Customer documents. - Enabled deletion at the
update
Form Access Mode, if the customerstatus
isInactive
.