Hi All, i want to set invetory detail via suite sc...
# suitescript
s
Hi All, i want to set invetory detail via suite script on item fulfillment record. Is it possible via client script? Thanks
n
It is not.
s
Ok, i will use user event script. Thanks
n
You won't be able to use before/after submit events. Inventory detail is required to create IF. It will not save without that information.
s
Ok, then how can we do it?
s
https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4686991741.html take a look, hope this helps. If you're in CS it's dynamic, if you're in UE, it could be either depending on your situation. (record.load with isDynamic true or false, or with context.newRecord)
s
It will not work because fulfillment will be created manually
@NickSuite Any solution?
n
Yes, place a button on your sales order. Call the suitelet from that button and create the IF and assign the inventory details.
s
@SS not sure whats the gap here,
regardless of whether or not it is created manually i have shown through that article it's possible to create the subrecord client or UE
s
@NickSuite is it not possible via user event (before load)?
s
@SS you need to take some responsibility in validating what's being said from this environment.
s
Sorry i didn't get it. Can u pls explain?
s
inventorydetail belong in the subrecord. test that, test creating the subrecord
test creating the subrecord in both dynamic record and in standard record, both behave differently, but test and see it's possible to manipulate records is something okay
s
i don't want to create IF via script, just want to set inventory detail when IF created manually
s
are you prepared to do any customization? because you could possibly create this via client script
s
we can't use subrecord api in client script..correct?
s
okay, we're not on the same page
when I showed you the documentation that this is possible on dynamic mode, it is possible in client script
c
Why do this in a client script?
s
But we use dynamic mode when create/load the record.
c
Can't you set the inventory detail OnSave?
with a UE script?
s
either way would work and its up to them, before submit would also work sure
c
I did a lot of work on inventory detail last year, from what I remember, that's how I did it.
s
i would also agre instead of having the browser freeze to do the calculation serverseide is almost always the way forward
c
Make sure your client really knows what they are doing if they want to use inventory details / lot numbers - it has lots of other implications and youll be stuck with it forver.
s
Sorry little confuse. I want to set inventory detail on fulfilment when item fulfillment created manually. Using which script type i can do it? please help
s
Both is capable, if you read what I sent you, and it's up to you
imo then closest test is if they csv import if they do, it's gonna be beforesubmit UE, if not it'll be a cs
s
CS onSave?
s
whateverm doesnt matter
it only matters for cs on save if CS determines stuff not registered on the NS System here
not about what can be grabbed on NS before or after save or related or nto to this
n
CS cannot read inventory details. And IF will not save without inventory details so UEs are out of the question.
s
User event before load?
s
@NickSuite i believe what you say, but if I am in this project the only way anything can occur ultimately is if we can demonstrate that this is a defect, and that the gap is dealt by netsuite. As each different version of netsuite changes I would query and question myself every episode for the final outcome. i gave an example so try it, if it doesnt work, raise a ticket given it's the documentation. If it does work then use it.
n
@Sciuridae54696d it's not a defect. Defect is when things are not working as they are designed.
s
I'm saying, inventory detail is a subrecord, if you cant manipulate it as a subrecord it's a defect, and face it as a defect
otherewise, if it isn't a subrecord, that raise it as a case that it itsnt a subrecord, then its also a defect
n
@SS did you try client script?
@Sciuridae54696d from the article, it says "To create a sublist subrecord, your script must use the N/record Module." Client script has N/currentRecord object, not the N/record object.
s
the moment that it can have dynamic mode as true, you can try to test it before saving and creating the record instance
dynamic mode is mimicing creating the record in the UI, thats the crux
the ability of anythign being able to be created in the ui is the first priority of whether or not something can be scripted
not saying its a must to test, but its a must of something you cant not test.
n
I don't follow. If you use N/record module in client script, it will create a new record and not update the inventory details on the current IF record that user is trying to create.
s
nope
the documentation I showed you say in dynamic mode isa bout getting the current line information
so when you're creating the record or editing the record in dynamic mode, you'lll get the subrecord information and edit it
and be editing it you can fill the the fulfilment infomation of the current line of the the dynamic mode of the record
subrecord has it's own behavior which is different so im not supprised its suprising for you
an example like the customer's address, that's unique and standalone as as subrecord much like what the inventory detail will be
d
excuse me but everybody in this conversation seems to be answering their own question, then throwing a lot of extra information thats pretty confusng. im gonna summarize the informationclient scripts are completely doable using
N/currentRecord
on the saveRecord entry point
user event scripts are possible on beforeSubmit using
N/record
it sounds from your use case that a Client Script is better for you than a User Event.
eventually you may consider making this perform better by creating some sort of loading animation modal.
b
the basic answer is that suitescript does not support subrecords like inventory details in client script
the more advanced answer that is still a no is that setting body level fields on subrecords work while sublists on subrecords do not
so only setting address subrecords work in client script
you wont be able to use a user event script either, you cant set subrecords in a before load user entry point
and inventory details are usually mandatory, so its too late to set it before or after submit
you will probably have more luck deploying a client script to the inventory details record and doing what you need there
n
thank you @battk for confirming what I was trying to explain. @SS the only possible solution - if you want to automate the setting of inventory details on IF is by using a custom button + suitelet on the sales order. Use the suitelet to generate the IF and set the inventory details.
s
@battk @NickSuite thank you so much. Appreciate your help.