Hey all, Does anybody know of a way to source ite...
# suitescript
m
Hey all, Does anybody know of a way to source items in on a
beforeLoad
event before said record has actually been saved (in other words, a
beforeLoad
function called on a
create
event)? I've been trying but
newRecord.selectNewLine()
does not work (or it's SuiteScript 1 equivalent). (For context, I'm trying to add copies of items on a
salesorder
to a
purchaseorder
which I can technically use transformation to do... but it's not "supported" - and I really don't want to clumsily do it in a client script either).
m
Add_PO_line_items_during_beforeLoad_on_CREATE.js
In
beforeLoad
during a
CREATE
event, the record is in standard mode so you don't need to select a new line before adding line items. You can use
.setSublistValue()
and specify the lines starting with line 0.
👍 1
m
@Mike Robbins Thank you! Actually I just discovered this right as you typed this. Thanks for your help.
a
SO > PO... isn't that just a drop ship?
m
Wish that Netsuite documentation was better.
@Anthony OConnor Yep, but we need some more flexibility than Netsuite grants us. Or at least compared to the inter-subsidiary one.
a
k just pointing it out in case you just didn't know about that feature at all 🙂
m
I'll try and double check on drop ships though
I was aware of it... but I've only explored it in the subsidiary context. If we don't use the intercompany transactions... it might be okay? I'll check it out.
a
can't hurt to look I suppose ¯\_(ツ)_/¯
m
@Anthony OConnor Just looked at them. Won't work for us unfortunately. We need to receive them into our inventory. But thank you so much for the suggestion, I will keep this in mind for other things :D.
👍 1
c
@Michael Pope If you need to receive it into inventory but you want to mark it for this Sales Order / restrict commitments on the received items to this Sales Order, select "Special Order" instead of "Drop Ship" under the Create PO column.
m
@Clay Roper Thanks! I'll take a look at this 🙂
🙌 1