-> Ensure to use the correct API Names for both Module & Fields in the script.
-> To ensure you get the intended output, we would suggest you to use info() logs to each variable to check the output for seamless functionality under the Console section within Zoho CRM Function IDE.
-> Since we have used the Connections within a function script, ensure to have the required scopes added in connection to perform the intended API action. Also, ensure to use the connection link name (i.e., crm_connection ) while passing on to Deluge Invoke URL or Integration Task.
-> As a common practice, we have used US DC API end point. If you are using CRM account in a different DC (i.e., IN, EU, CA, AU, etc.), then we would recommend you to use the API end point URL according to your DC.
For example:
-> Since the Automation Feature (e.g., Workflow Rules) is involved in this use-case, if the intended functionality does not work, then users can check the associated function failure reason under "Setup >> Developer Hub >> Functions >> Failures". Additionally, Users can also see the complete Log of all function execution for any specific created function to track the executions (i.e. under My Functions >> 3 Dots >> Logs). This also help in a scenario where a function is executed via Workflow rule in CRM record(shows in timeline), however it didn't perform the intended actions/updates in record. In such scenario, users can check the output (info logs) & error of execution via function logs within Zoho CRM.
Notes: Refer to the following Guide - Article to learn the best practices for Optimizing the code and various ways to deploy Custom Function across Zoho CRM.