Good afternoon all - I've got a workflow action sc...
# suitescript
t
Good afternoon all - I've got a workflow action script that I am trying to set the account field on and it's being difficult. I tried the internalid, the account number, the account name and keep getting: You have entered an Invalid Field Value XXX for the following field: account
for clarity, this is the account field on the expense tab of a bill
b
in general you set fields using internal id number, and it has to be a valid choice for the record. that means valid subsidiary and the like
t
yes - I created the bill in the UI under the same transform scenario and pull the internalid of an account that is a valid UI option
b
what does your code look
t
vendor_bill.setSublistValue({ sublistId: 'expense', fieldId: 'account', value: expense.account, line: eCount });
b
i cant really tell anything from that code beyond you are setting the account of the expense sublist
t
it must be related to sub or something because one of the other account ids work
b
but if you have a valid internal id in the value and a valid line in the line, then it looks normal
t
yeah, the code is a bit convoluted so I didn't want to distract
b
as i mentioned earlier, check that the subsidiary is valid for the account
t
perhaps it's that it must be an expense account?
b
if you can set that account in the ui, you should be able to set it in the script
t
that's where I am seeing the discrepancy. it's the vendor's sub that is relevant here right?
the sub on the bill is 1, and from what I can tell this is not a oneworld account
e.g. when I search for subsidiaries there is no result
one other note is that the account is non-posting
I think it's likely that a non-posting account can't be used, because I can change it to another account type and it works
thanks for rubber ducking!
b
i was about to say you cant select a non posting account in the ui so its unlikely that you can in script
t
I could definitely select it in the UI, although I did not attempt to save it, likely that it would stop me there.