Hi All Can we clear `inventory Detail` on a record...
# suitescript
r
Hi All Can we clear
inventory Detail
on a record when we make a
copy
of it? I have tried the following • UE: Get a error that I'm not allowed to modify the Subrecord on Before Load • Client Script Page Init: Nothing happens when I try to use
removeCurrentSublistSubrecord
c
What's the requirement that you make a copy of the record?
r
So my client copies a sales order but does not want to use the same lots on the SO lines. They have to choose different lot numbers but sometimes they have used the old lot numbers. They seems to have forgotten to select new lots in the past and has caused issues.
c
Can you use a search and compare lot values on save? Alert when there are duplicates?
r
I would have preferred to clear it on load of the sales order as it may be a genuine case were they do have the same lots on both sales orders
c
Can you inject a custom Copy button that creates a new Sales Order and copies over the field values that the clients wants copied?
r
The issue with that is every time a new field is added ,we will need to update the script.
c
You can get all the field IDs on the record and iterate over them using Record.getFields()
You might need to filter some out, but that would be a more robust approach than maintaining a list of fields to filter in
r
I'll propose this to the client and see what he thinks.
thanks for the input
c
re your pageInit script: you're selecting a line before using
removeCurrentSublistSubrecord
?
r
|re your pageInit script: you're selecting a line before using
removeCurrentSublistSubrecord
? yep
c
Are you sure it's possible to have a Sales Order line for a lot-controlled item without inventory detail?
r
yep on a sales order you can
👍 1