Below is the snippet I wrote but seems to be not w...
# suitescript
u
Below is the snippet I wrote but seems to be not working oSalesOrderRec.selectLine('item', j); oSalesOrderRec.setCurrentSublistValue({ sublistId: 'item', fieldId: 'quantitycommitted', value: itemQty }); oSalesOrderRec.commitLine('item')
e
I believe this depends on settings in the account. Look for commitment settings.
u
Thank you, I have a unique requirement where it needs suitescript help to commit orders. I was wondering if it can be acheiveable through script or not. The code that I shown above throws no error also it doesn't commit the SO line items
e
That won't commit it, no. But how you can get to commit may depend on your settings, is my point. If auto commit is on, then you need to reallocate somehow. If not, you may be able to modify the commit settings on the line (available quantity, etc). Are you familiar with that field?
u
So the scenario is we use intercompany transfer order, and it has associated sales order, upon receiving the items from transfer order it doesnt allocate the items to associated sales order rather it picks some random sales order and allocates the inventory. The issue I'm trying to solve is to deploy the UE script on Item Receipt and fire on after submit that searches the related sales order and commits it but the allocation isn't happening through the script. Does this makes sense?
e
I've seen similar situations. 🤔 Does priority help you at all? There is a priority for committing lines as well
u
Yeah I understand about priority allocation, but priority doesn't matter here since the items are received through intercompany transfer order that has associated sales order, and the items needs to be allocated to this SO no matter what. As of now we are using reallocate items page to move the commitments. But this is again a big manual process.
I'm really hitting a dead end. Your expertise matter allot.
e
The IC TO is associated with the order natively? Or is that a custom association?
b
you can experiment with the
reallocateitem
record type, but keep in mind that there is no documented support
b
commitLine only works with dynamic mode?
u
@ec It gets natively associated upon creation of a IC transferorder
The reallocateitem record only supports userevent script and when I hit submit button it auto selects the orders again it would be a manual process I guess.
@Boris Yasen yes the commit line works only in dynamic mode, I even tried in standard mode using setsublistvalue but it didn’t work
b
did you actually try using record.create?
u
@battk I haven’t, I will try it and update here