hi All, I have a client script on sales order, on ...
# suitescript
d
hi All, I have a client script on sales order, on PageInit i will populate SO line items from my array as example below
Copy code
[
 { iteminternalid: 123, itemtype:"itemgroup", memo: "The header of item group" },
 { iteminternalid: 124, itemtype:"inventoryitem", memo: "1st component of group" },
 { iteminternalid: 125, itemtype:"inventoryitem", memo: "2nd component of group" }, 
]
My item Group has 4 components as below:
Copy code
Item internal id 123
 1. internalid 124
 2. internalid 125
 3. internalid 126
 4. internalid 127
The expectation is that i will see 4 line items in SO as below 1. item 123 2. item 124 3. item 125 4. End group but instead i see 1. item 123 2. item 124 3. item 125 4. item 126 5. item 127 6. End group 7. item 124 8. item 125 I know the the problem is that when i insert the Item Group netsuite will auto add all the components, but i don't know the solution. Help is really appreciated Thanks
a
You only need to add the item group line, the components would be added automatically, you don’t need to add the individual components.
d
I want to be able to define which component to stay and which one to remove, because user can sometimes sell the item group without some components
a
Then you must add the Item Group and after that action is completed, you remove the components you don't want.
d
in which method/entry points of client script i can detect that Netsuite has completed auto added the item group components ? do you have any sample script for reference ?
a
No sample script for this particular problem, you can try
postSourcing
otherwise you can try
lineInsert
or
validateLine
to determine when the End Group line is being added, then determine de Group Members and delete the ones you don’t need.
d
i have tried all postsourcing and validateline with no luck, i will try lineInsert
lineInsert
=
validateInsert
?