Hi there,
I have a table recording items in an inventory adjustment, the table is called "Inventory Adjustment Items", whose columns are:
I also have a table called "Inventory Adjustments" recording the inventory adjustment itself, which has columns:
Finally, I also have a table, called "Inventory Stock Balances", recording the latest inventory quantity snapshot for a Department, Section, and Inventory Item Id combination.
I try to create a webhook API action as follows:
<<START: [Related Adjustment Items]>>
{
"Department":"<<[_thisrow].[Department]>>",
"Section":"<<[_thisrow].[Section]>>",
"Inventory Item Id": "<<[Inventory Item Id]>>",
"Latest quantity": "<<
ANY(SELECT(Inventory Stock Balances[Latest quantity],
AND([Department]=[_thisrow].[Department],
[Section]=[_thisrow].[Section],
[Inventory Item Id]=[Inventory Item Id]
), TRUE)) + [Quantity]>>",
}
<<END>>
The highlighted Inventory Item Id filter above (bold and italics) does not work. I think the expression is confused by the exact same name of the column filter and the column reference in the "Related Adjustment Items" loop.
Is there any way to fix this confusion? Basically, I want to increment the Inventory Stock Balance record matching the Department-Section-Inventory Item Id key with the quantity input in the adjustment item record.
Latest quantity = select latest quantity with the key + Quantity input.
Thanks in advance for your help,
-- Hendi
Solved! Go to Solution.
@devmasadajaya wrote:
I think the expression is confused by the exact same name of the column filter and the column reference in the "Related Adjustment Items" loop.
Is there any way to fix this confusion?
Maybe I have not understood the issue precisely. However if the error is just because of identical name, is it possible that you can slightly change the names of the column in respective tables and test once?
Something like
[Inventory_Item_Id_IA] for the column name in Inventory Adjustments table and
[Inventory_item_Id_ISB] for the column name in Inventory Stock Balance table?
Thanks for your response, Steve.
I tried:
This webhook API is a task:
In the webhook, I am looping through all the related Inventory Adjustment Items record in the Inventory Adjustment, to perform an edit on the corresponding Inventory Stock Balance record (the relation is through the Department+Section+Inventory Item Id key combination).
Here is the simplified snippet of the webhook body:
{
"Action": "Edit",
"Properties": {
"Locale": "id-ID",
},
"Rows": [
<<START: [Related Adjustment Items]>>
{
"Department":"<<[_thisrow].[Department]>>",
"Section":"<<[_thisrow].[Section]>>",
"Inventory Item Id": "<<[Inventory Item Id]>>",
"Latest quantity": "<<
ANY(SELECT(Inventory Stock Balances[Latest quantity],
AND([Department]=[_thisrow].[Department],
[Section]=[_thisrow].[Section],
[Inventory Item Id]=[Inventory Item Id]
), TRUE)) + [Quantity]>>",
}
<<END>>
]}
It seems I am still missing a certain way of referencing properly.
Thanks again for your help,
-- Hendi
@devmasadajaya wrote:
I think the expression is confused by the exact same name of the column filter and the column reference in the "Related Adjustment Items" loop.
Is there any way to fix this confusion?
Maybe I have not understood the issue precisely. However if the error is just because of identical name, is it possible that you can slightly change the names of the column in respective tables and test once?
Something like
[Inventory_Item_Id_IA] for the column name in Inventory Adjustments table and
[Inventory_item_Id_ISB] for the column name in Inventory Stock Balance table?
Yes, Suvrutt, thanks for your suggestion. Changing the name is what I have done yesterday, and it works just fine.
I am just curious in how we can handle the column name reference ambiguity. ๐
@devmasadajaya wrote:
Yes, Suvrutt, thanks for your suggestion. Changing the name is what I have done yesterday, and it works just fine.
You are welcome. Thank you for the update. Nice to know it works.
@devmasadajaya wrote:
I am just curious in how we can handle the column name reference ambiguity.
Could you elaborate.
User | Count |
---|---|
21 | |
15 | |
4 | |
3 | |
3 |