Charlie
05/13/2026, 5:47 AM{line.item.custitem_product_status.id}=2
I want to extend this to also check whether the quantity ordered on the sales order line is greater than the quantity on hand for that item at a specific location (the line's location, or a fixed location like "Entity Brands" / internal ID 1).
My account uses multi-location inventory, so I need the location-specific quantity, not the total across all locations.
Questions:
1. What is the correct workflow formula syntax to reference the quantity on hand (or quantity available) for an item at a specific location from a sales order line? Does something like {line.item.locationquantityonhand} or a join through inventorylocation work in a workflow formula context?
2. If location-specific inventory quantities cannot be referenced directly in a workflow formula, what is the recommended approach? For example:
◦ A saved search formula field on the item record that I can then reference in the workflow
◦ A Before Submit User Event script that sets a custom checkbox/field which the workflow reads
◦ A different workflow action type (e.g., Set Field Value sourcing from a saved search)
3. Can you provide the exact formula or script snippet, including the correct field IDs and join syntax?
For context, here's my existing working formula that successfully joins through line and item fields, so I know those joins work:
{line.item.custitem_product_status.id}=2
and {line.item.isonline.id}='T'
and {line.item.location.id}=1
and UPPER({line.location.custrecord_5826_loc_branch_id})=UPPER('')
and {line.custcol_scm_itemsub_original_item.isfulfillable.id}='T'
I'd like the new quantity check to follow the same style if possible.
That should give the bot enough context to either hand you a working formula or steer you toward the right workaround. If it gives you something that looks plausible, paste the answer back here and I can sanity-check it before you deploy.Celigo AI
05/13/2026, 5:47 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems that directly referencing location-specific inventory quantities in a workflow formula is not straightforward. However, there are a few workarounds you can consider: 1. Saved Search Formula Field on the Item Record: You can create a saved search formula field on the item record that calculates the quantity on hand for a specific location. This field can then be referenced in your workflow. Here's an example of a formula you might use in your saved search:
CASE WHEN {location} = {item.inventorylocation} THEN {item.locationquantityonhand} else 0 END
Please note that you would need to adjust the formula to match your specific field IDs and requirements.
2. Before Submit User Event Script: You can write a Before Submit User Event script that calculates the quantity on hand for a specific location and sets a custom checkbox/field on the sales order line. The workflow can then read this field to determine whether the quantity ordered is greater than the quantity on hand.
3. Set Field Value Workflow Action: You can use a Set Field Value workflow action that sources the quantity on hand for a specific location from a saved search. This approach would require you to create a saved search that returns the quantity on hand for each item at the specific location.
Unfortunately, I cannot provide an exact formula or script snippet without knowing the exact field IDs and requirements of your NetSuite account. However, I hope these suggestions provide a good starting point for you to explore.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/13/2026, 5:47 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.874328613
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.870666504
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865844786
Celigo AI
05/13/2026, 5:47 AM