Create a Work Order in Zoho FSM from a Sales Order in Zoho Books
Use case: Whenever a Sales Order is created in Zoho Books, create a Work Order for it in Zoho FSM.
Follow the steps below to implement this use case:
Step 1: Create a connection for Zoho FSM in Zoho Books
To create a connection for Zoho FSM that can be used in Zoho Books for invoking the Zoho FSM APIs, do the following:
- Log in to Zoho Books.
- Navigate to Settings > Developer Data > Connections and click New Connection.

- Under the Default Services tab, search for and click Zoho FSM.

- Do the following and click Create And Connect:
- Connection Name: Zoho FSM
The Connection Link Name will be automatically populated. Disable Use Credentials Of Login User. If this is disabled, the connection will utilize the credentials of the connection owner.
- Select the Scope ZohoFSM.modules.all.

- Click Connect in the authentication page.

- Click Accept in the Authorization page.

In the
custom function, where FSM APIs are used via the invokeURL task, use this
Connection Link Name.
Step 2: Create a custom function in Zoho Books
Create a custom function that will generate a Work Order in Zoho FSM from a Sales Order in Zoho Books.
- Navigate to Settings > Automation > Workflow Actions. Select Custom Functions and click New Custom Function.

- Enter the following details and click Proceed:
- Function Name: createwofromso
- Module: Sales Order

- In the Deluge Script Editor, enter this script and click Save.
In Zoho Books, ensure that the status of the internal connections for Zoho Books, and Zoho FSM Integration tasks is
Connected. The green dot [

] indicates that the connection is
Connected.
Step 3: Create a workflow rule in Zoho Books
Create a workflow that will generate a Work Order in Zoho FSM whenever a Sales Order is created in Zoho Books.
- Navigate to Settings > Automation > Workflow Rules and click New Workflow Rule.

- In the New Workflow Rule popup, enter the following details and click Next:
- Workflow Rule Name: CreateWOFromSO
- Module: Sales Order

- For Workflow Rule Execution Condition, enter the following details and click Next.
- Workflow type: Event Based
- Action Type: Created

- Click New Criteria.
- Select No for Add criteria for this workflow rule? and click Done.

- Click Immediate Actions.

- Select the Type as Custom Functions and for Name, select the function created in the previous step. Click Associate.

- Click Save.

Testing the use case
Following are the steps to test the use case discussed.
- Ensure that the Sales Orders module is enabled in Zoho Books. You can check this at Settings > Preferences > General > Select the modules you would like to enable.

- Navigate to Sales > Sales Orders and click New.

- Enter the necessary details and save (Save as Draft, Save and Send, etc.) the sales order.
If you are creating a sales order using a Zoho FSM contact, ensure that a Service Address, Billing Address, and Email is present for the contact. If you are creating a sales order using a customer present only in Zoho Books, ensure that the customer is of type Individual and they have an email. Since a work order in Zoho FSM should have at least one service, ensure that you add to the sales order a service that is present in Zoho FSM. If you do not want to add a service in your sales order, in Zoho FSM create a dummy service with Unit Price zero, and make use of it in the sales order.

A new work order is created in Zoho FSM for the same customer for whom the sales order was created in Zoho Books.