Hello. I tried to change subsidiary and location i...
# suitescript
b
Hello. I tried to change subsidiary and location in Suitescript using
record.submitfields
but it shows me
This customer record -1 is not valid. Please create the customer first.
But the invoice already has customer configured. Could someone help me how to solve this issue please? I tried
ignoreMandatoryFields:true
but it didn't work
c
Paste some code.
Are you even allowed to change the subsiiary on an invoice? I feel like that would have a significant downstream impact.
c
I'm pretty sure when you change the subsidiary it blanks out the customer field, I would also re-set the customer field on the invoice before saving.
m
Since you're using
record.submitFields()
, this is trying to perform an
XEDIT
on the transaction, not a regular
EDIT
. In an
XEDIT
event, the
newRecord
object doesn't have access to all of the fields. It sounds like you have another user event script that is expecting an
EDIT
event but since it doesn't have all of the fields, it thinks the customer field is not populated. By default, the
newRecord
object in an
XEDIT
event only contains the values that were updated. It doesn't have all the values on the record itself.
c
XEDIT aside; it’s still not going to work changing the subsidiary on an existing invoice right?
m
You may be able to change the subsidiary on a transaction if you have the "multi subsidiary customer" feature enabled. Not sure, through. I don't have access to an account with that feature enabled.
l
You can't change the subsidiary in an existing transaction except, I think, for Journal Entries. But general rule is no.