4. Implementation steps
Prerequisites :
Before you begin, create the Approvals module and the Discount_Approval lookup field on Deals. The skill lists the field names it has assumed. If your fields already exist, share their API names and the skill will update the code.
Then follow the steps the skill shares, in this order, since some pieces depend on others.
Step 1. Create the Connection
- Go to Setup > Developer Space > Connections.
- Use the exact name the skill mentions, because the function calls it by name.
- Select the listed scopes, authorize, and make sure the connection is in your CRM’s data center.
Step 2. Create the Function
- Go to Setup > Developer Space > Functions and create a new function.
- Paste the generated code and verify that the API names are correct for your organization.
- Save it and test it with sample values using info statements and the execution logs.
Step 3. Upload the Widget
- Ask the skill to package the Widget and provide a ZIP file ready to upload.
- Go to Setup > Developer Space > Widgets and create a new widget.
- Set Hosting to Zoho, upload the ZIP, and give the index page path.
- Set the Type to Button, which is required to open it through a Client Script.
Step 4. Create the Client Scripts
- Go to Setup > Developer Space > Client Script.
- Create the two scripts the skill provides, using the module, page and event it recommends for each.
- Paste each script as generated and save.
5. Test the flow
- Open a Deal and enter a discount above 20%.
- Check that an error message appears next to the Discount field.
- Click Save and check that the dialog box opens.
- Enter a reason, select an approver, and submit.
- Confirm that a record is created in the Approvals module, the discount is set to 20%, and the “Sent for approval” message appears.
- Also, the Discount_Approval lookup field should be populated with the corresponding Approval record name
Here is how the implementation works.