Hi everyone, does anyone know why the `nlapiTransf...
# general
j
Hi everyone, does anyone know why the
nlapiTransformRecord('salesorder', '874788', 'itemfulfillment');
script might not work when trying to create an Item Fulfillment from an existing Sales Order?
s
Maybe if there is nothing committed?
j
Items have been committed
I get this error:
"You must have at least one valid line item for this transaction."
When I run it through console
r
Have all the lines been fulfilled?
b
most normal reason is what @rustyshackles, there are no lines to fulfill, so you can't fulfill the order
harder to diagnose are things like ship groups, or line level location
which require a tranform value to be specified
usually you can tell from looking at the url of the item fulfillment when you create it from the sales order from the ui
j
So I’m able to fulfill it manually through the UI, but when I use the script it errors out… That wouldn’t be the case if all the lines have been fulfilled right?
b
and the url when you fulfill it in the ui
That’s the url when I fulfill via UI
b
line level location on the sales order?
j
Same, it’s the name for location 305
b
wait a minute, i remember you
i told you the same thing last time
🤣 1
j
Lol yup
I tried it… didn’t work
b
nlapiTransformRecord('salesorder', '874788', 'itemfulfillment', {inventorylocation:'305'});
j
Oh okay, I’ll give that a try
b
as i said last time, you need to use the transform values of nlapiTransformRecord
j
Uncaught SyntaxError: Unexpected token '{'
b
sorry, i used a . instead of a ,
j
nlobjRecord {type: "itemfulfillment", id: null, fields: {…}, fieldnames: Array(145), lineitems: {…}, …}
I don’t get an error, but I get nothing
b
you need to set fields on it, then save it
depending on your account's configuration, you may be able to just save it
j
Set fields, as in pass in location, sku, etc?
b
whatever you would do in the ui, is what you would want to do in script
j
Hmm… I do nothing in the UI. I just press
Fulfill
when I’m on the Sales Order record and then when that opens up the Item Fulfillment record, everything is already populated and I just press
Save
Ohh hold on…
b
j
Yeaa
How do I set line level item fields in the url?
ie… {‘inventorylocation’ : 305, ‘i need line item market’ : ‘xyz’
b
not a thing
j
Ahh interesting
Thanks
b
if you are still using celigo, they probably have a way of setting those transform values
j
Thanks @battk, that worked! Appreciate your help!