When a user clicks the "Create Build" button on th...
# suitescript
x
When a user clicks the "Create Build" button on the work order, it opens Assembly Build record creation page Assembly Build record has line components, there are non-serialized items and it's possible to add 'binnumber' to its inventory detail popup page. Does anybody know how to set inventory detail information to those non-serialized items using SuiteScript while creating Assembly Build? For the solution, I tried 2 ways, one is using UserEvent, the other is using Client Script When I'm using UserEvent, on "BeforeLoad" type, the script doesn't allow to call "selectLine" for components, and failed to go on next logic Also, when using Client script, it doesn't allow to use "selectNewLine" in client page_init function
b
you dont use dynamic mode methods like selectLine when working with records in standard mode
you just methods that have a line parameter, like Record.getSublistSubrecord
not that it matters for your use case, you cant set inventory details in a beforeLoad entry point
and as you discovered, you cant set sublists on the subrecord in client script
the closest you will get via suitescript is a client script deployed on the inventory detail record
x
thanks for the details could you let me know how to deploy client script on the inventory detail record? in detail, while creating assembly build, is there any way to run that client script to run together?
b
x
thanks
hi, @battk could you explain me more details about the client script deployed on the inventory detail record? currently, i have build a client script which is running on page_init function for Assembly Build record and it's trying to set inventory details with binnumbers btw, could you please let me know how to compose the client script which is deployed on the inventory detail record? i.e. on which function (page_init, field changed etc) in this client script, what will be resolved?
b
depends on what you are able to implement
you are only able to get a client script on the inventory details subrecord
which will only be an option after clicking the appropiate button the component line
x
ah, on Assembly Build creation page, when the component line is clicked, the client script is running and can populate inventory details on the popup page
the main target is to build Assembly Build record automatically for alternative solution, I added a custom button on work order and when it's clicked, trying to create Assembly Build record in suitelet here, for non-serialized items, it's able to add inventory detail from a custom field which indicates the binnumber also, for other items, planning to pre-populate inventory details in work order first so that once non-serialized items are done with inventory detail in suitelet and save the record, Assembly Build record will be created this is just my alternative solution, but it includes some additional issues • assembly build on the main area should be configured with inventory detail with lot number, bin number, qty • also, for non-serialized items, if the indicated binnumber is not enough with item qty, then it should reference other binnumber too @battk could you please provide me the proper solution for this again? thanks
b
there is no proper solution
closest suitescript solution is client script deployed on the inventory details so that you can manupulate the invetory details
if you dont need to actually make it work on the assembly build page, then dont
x
@battk could you please let me know what's the usage of client script which is deployed on inv details? i am not sure what can be manupulated on inv details using client script what is difference with manual adding?
b
the normal process is click inventory detail button, add inventory assignment sublists, save
suitescript will allow you to automate adding the inventory assignemtn sublist
you will need to do something else for the clicking invetory detail button and save button
normally manually clicking them
x
i see, on inventory details popup page, without adding manual selection/add qty, it can be done automatically and click save
last question, is there any way to pass "Assembly build" body field value to that client script?
as client script is deployed to inventory detail, i guess it doesn't have relation with Assembly Build record
b
the inventory details popup is implemented via a iframe
meaning you have access to the original page window.parent
x
i see, thanks for your info
@battk sorry, again. can i confirm an issue again? currently, when inventory detail popup page is opened, i succeeded to retrieve binnumber from parent window and set it to inv detail line item next thing (#3) is to set the component quantity to inv detail line could you please teach me again for this? i'm not sure how to identify the selected component on the inventory detail popup form
b
make a fieldchanged entry point that logs the script context parameter
do the actions that you want in the ui manually, then take a look at the logs to see which fields were set
x
@battk currently the client script is deployed on inventory detail could you tell me how to apply it only when the inventory detail is opened on Assembly Build creation page?
ie. in inventory adjustment record, click "inventory detail" icon, it throws error now
b
you can take a look at the parent record's type
alternatively you can inspect the iframe's url
x
@battk i'm really sorry, can i ask another issue again? for some items, If the item only has QTY in a single bin, then it will default to that Bin automatically currently, it only requires to set "Bin To Pull From" bin number only for all items and if the item doesn't have inv qty available in that bin number, then the item should not have bin number basically in a word, only "Bin To Pull From" bin number can be used for default bin number for all items otherwise, should be empty at the beginning and then, user can do settings manually later could you please let me know how to remove such default set bin number?
b
x
those bin numbers are set to the item automatically by netsuite it makes difficult how to analyze if bin number is added by netsuite for default case or it's added by user manually for his purpose
b
make your script keep track of what it does
101 Views