Anyone with experience of creating Item Fulfillmen...
# suitescript
s
Anyone with experience of creating Item Fulfillments from Fulfillment Requests? Record.transform doesn't seem to be supported here
b
s
@battk We use warehouse to fulfill so we create Item Fulfillments and not Store Pickup Fulfillments.
b
then it should be a record transform
with some default values
take a look at the parameters in the url of the item fulfillment while you create it in the ui
any new ones are probably default values you need to set in your transform
s
When I do the fulfill in the UI from the Fulfillment request, the URL reads: /app/accounting/transactions/itemship.nl?id=35148&e=T&transform=salesord&memdoc=0&fftreqid=41577&whence=
So it seems to still be a transform from the sales order then
b
correct
s
But should I be able to set fftreqid=41577 in the default values?
b
try it out
if that fails, you can also try setting memdoc, but i doubt that is necessary
s
What is memdoc?
b
record copy related
s
Should it be set as a default value too?
b
i would only try it in desperation if fftreqid by itself failed
s
Copy code
let fulfillmentRecord = record.transform({
    fromType: record.Type.SALES_ORDER,
    fromId: 35148,
    toType: record.Type.ITEM_FULFILLMENT,
    isDynamic: true,
    defaultValues: {
        requestedby: 41577}
});
I get error: "You have entered an invalid default value for this record transformation operation.\"
b
you copy and pasted your default value wrong
s
Which part is wrong?
b
you did the equivalent of requestedby=41577
s
And what should it be instead?
The id of the requestedby transaction is 41577
Copy code
let fulfillmentRecord = record.transform({
    fromType: record.Type.SALES_ORDER,
    fromId: 35148,
    toType: record.Type.ITEM_FULFILLMENT,
    isDynamic: true,
    defaultValues: {
        fftreqid: 41577}
});
Like this?
b
i have no idea where you got requestby from
s
I thought it should be the field id in NetSuite
b
nope
s
Thing I got to work now though
Sorry for all the questions. Never used the defaultValues in a transform before
b
i liked the old name of transform values
clearer that its not related to fields