When we add any item (which is an Assembly/Bill of Materials) in a Sales Order record, we have to create Work Order for that Item. And to build that Item we need to create Assembly Build record.
Sales Order > Work Order > Assembly Build
Now in one of my project client asked to populate all the sublist Items in Inventory Details (it is a subrecord type attached to body field of Assembly Build) from the sublist Items from Inventory Details(subrecord of Work Order(parent record of that Assembly Build)).
Work Oreder : Inventory Details:
1.Sublist Item 1
2.Sublist Item 2
I had to populate the above two items in the Inventory Details(body field subrecord) of Assembly Build.
The most difficult thing was I couldn’t directly access the Inventory Details as it is a subrecord.
Then I started using all the nlobjRecord and nlobjSubRecord methods.
We get the Sublist Item from Work Order’s Inventory Details record if the there exists only one sublist Item. So in that case there was no problem.
But the problem appeared when there was Inventory Details having more than one sublist Item, I got only the first line item.
Then by consulting Netsuite support guys, they said it is a defect in netsuite.
Then I came with a different approach.
I tried to get all the Inventory Details information using a Save Search of type Work Order by using “Inventory Details Fields…” in results of Save Search.
There I got all sublist Items easily.
Then In Page InIt event of Inventory Details, I set all those sublist items.
And it worked like wow..
Thanks to Netsuite guys who have implemented the concept “SAVE SEARCH”.
In Netsuite my favorite is “Save Search”.
My suggestion is whenever you develop anything in netsuite, first check can it be possible using save Search because it is:
-We can get values from multiple records without searching or loading multiple record .
I will add more tips on save search in near future.