Introduction
ZOHO Inventory has an option to create a picklist from a sales order. However, default feature does not display "stock on hand" value for line items. It may confuse the picker when the picker goes to the warehouse and finds items are out of stock. Displaying stock on hand values of line items in a picklists is easily implemented using Zoho Sigma, extension development platform.
Use Case
When creating a picklist from a sales order in Zoho Inventory, all line items are listed in the picklist regardless of item's stock value. This default behavior sometimes confuses the picker who is assigned to pick up items according to the picklist when the items are out of stock.
This will be solved if the stock on hand value is displayed for line items in the picklist because the picker knows wether the items are in stock in advance and efficiently pick up items without wasting their time.
Prerequisites
Creating ZOHO Inventory Extension
In order to develop an extension using ZOHO Sigma.
First, go to ZOHO developer site (https://developer.zoho.com) and sign in.
Then select "Sigma" and click "Start Building" button as shown below screenshot.

Click "New Extension" button to create an extension.

Add the extension name, and type a description of the extension.
Select ZOHO Inventory icon in service section.
Check the agreement statement.
Then, click "Create" button.

ZOHO Inventory Developer Portal is displayed.

Creating connections
In order to access ZOHO Inventory data, you need first to create an connection for ZOHO Inventory integration.
Follow below steps:
- Click "Build" tab.
- Select "Connections" from left-side menu.
- Click "New Connection" button.

Type "Inventory" in the search box on the top left.
Then, click "Zoho Inventory" as a default service.

1. Enter "Connection Name".
2. Select following Scopes:
- ZohoInventory.picklists.UPDATE
- ZohoInventory.picklists.READ
- ZohoInventory.items.READ


Click "Connect".

Click "Connect" for ZOHO Flow access.

Click "Accept" to allow an access.

The connection to ZOHO Inventory is created.

Creating a custom field
In order to display "stock on hand" value for line items in a Picklist, a custom fields need to be created first.
To create a custom field, follow these steps:
- Select "Preference" from Menu.
- Select "Items" module from Submenu.
- Click "+New Custom Field".

Configure the custom field:
- Enter "Label Name".
- Select "Decimal" as "Data Type".
- Enter "Help Text" if necessary.
- Enter "0" as "Default Value".
- Select "Yes" for "Show when creating transactions".
- Select "Picklist" for "Includes in modules".
- Select "Yes" for "Show in ALL PDFs".
- Click "Save" to create the custom field.

"Stock on Hand" custom field is created in Items module.
Creating Workflow Actions
In order to display the stock on hand value, a custom function needs to be created.
- Select "Workflow Actions" from left menu.
- Select "Custom Functions" from submenu.
- Click "+ New Function" button.

Developing a custom function to get stock on hand values from items
Follow below steps to create a custom function.
- Enter "Function Name".
- Enter "Description".
- Select "Picklist" module.
- Click "Proceed".

Refer to the below sample code to write deluge scripts in the editor and click "Save" button.

Creating Workflow Rules
Now that the connection for ZOHO Inventory integration is established and workflow action is created, next step is to create an automation workflow rule.
Workflow Rule condition:
- Execute when a picklist is created or edited.
- Execute the workflow when Any field is updated.
Criterion 1: Execute for all the picklist.
Immediate Action: Execute a custom function to get stock on an value for the line items and set the value in a custom field of item module.
- Select "Workflow Rules" menu.
- Click "+ New Workflow Rule" button.

Follow below steps to configure Workflow Rule:
- Enter "Workflow Rule Name".
- Enter "Description".
- Select "Picklist" module.
- Click "Next".

- Select "Event Based".
- Select "When picklist is created or edited".
- Select "Any field is updated".
- Select "Edited each time".
- Click "Next".

Configure Criteria:
Click "New Criteria".

- Select "No" to execute for all the picklist.
- Click "Done"

Configure immediate actions:
Click "Immediate actions".

- Select Type, "Custom Functions".
- Select the custom function created above.
- Click ""Associate".

The workflow associated with picklist module is created.
Testing the extension
In order to test the extension, you can use the sandbox.
- Click "Test Your Extension" link on the top left corner.
- The sandbox ZOHO Inventory app opens in the separate window.

You need to enable "Picklists" module in the settings first.
Click the gear icon on the top right corner.

Click "General" menu under "Preferences"

- Make sure to check "Picklists" module.
- Click "Save".

Close the setting page and click "Sales Orders" menu.
Click "+New" on the top right corner.

- Make sure to select inventory items in "Item Table".
- Click "Save as Draft".

Click "Mark as Confirmed".

Nest, create a picklist from the sales order just created.
Click "Create" -> "Picklist".

Make sure you see "Stock on Hand" field is displayed in item details.
Click "Generate picklist".

Refresh the browser after a while. It takes a while to execute the custom function.
"Stock on hand" value is populated for line items.
The value is updated when a picklist is created or edited.

Publishing the extension
- Select "Publish" tab.
- Click "Publish" button.

- Select "Version".
- Typer "Rerease Notes".
- Click "Publish"

You can install the extension with the Private Installation URL.
Note: You can only install he extension for the same Zoho Inventory account you develop the extension. You need a private review to install it for your client Zoho account.

Conclusion
We demonstrated how to create an extension with ZOHO Inventory.
We use Sigma Platform in order to publish the extension.
You can create the same with ZOHO Inventory "Automation" setting.
It is quite easy to customize standard ZOHO Inventory functionality using extension.