I am trying to create a sales order with suitescri...
# suitescript
s
I am trying to create a sales order with suitescript 2.0 and am having trouble with the payment method field... My code is SO.setValue({                 fieldId: 'paymentmethod',                 value: 17             }); ...It throws no errors but the field is empty in the created sales order. ...the paymentmethod accounting list DEFINITELY has an entry for id 17
b
can you set the payment method in the ui with that value?
s
It is an accounting list item. so in the ui you get a list of the values, not the ids, that you can select from. ...and yes, the one that we want DOES show in the list in the sales order transaction ui
trying to set the name value in that field throws an error. it needs to take the integer that corresponds to the payment method we want to show.
b
wanted to check that the payment method was valid
and that your sales order form wasnt using terms instead
are you using dynamic mode?
s
This is on a create order. so dynamic mode should not enter into it.. Just trying to create a simple sales order with a payment method in the billing subtab
b
client script?
s
sorry, dynamic mode is valid for the sales order create but I do not see how it would affect the payment method as nothing else determines what is available in the list. and this is a restlet
b
if you are using dynamic mode, set payment method last
s
I will have to try that tomorrow... Funny thing though, when I do a record.load on a sales order, the paymentmethod field does not get returned in the object but it is definitely in there.
b
make sure whatever form is being used has the payment method field on it
s
Thank you... moving the payment method update to the bottom, just before save, worked. For my issue on reading it, it appears that the record.load does not include that field.
b
Copy code
SO.getValue({
  fieldId: "paymentmethod"
});
should get payment method