In a UserEvent beforeSubmit() I am trying to set t...
# suitescript
j
In a UserEvent beforeSubmit() I am trying to set the subsidiary for an Opportunity. If I have a setValue() to set the subsidiary, the record saves but it for some reason blanks out the class and department --- after/during save? I logged class/dept right after setValue on the subsidiary and before the beforeSubmit() completes, and their values were still there, they just seem to vanish as it’s actually saving. What the heck is going on here? The combo of subsidiary / class / department is valid.
I don’t see anything in logs unsetting it, it’s just somehow getting blanked out between the end of the beforeSubmit and the record actually being saved.
if I comment out my setValue({fieldId: ‘subsidiary’, value: subsidiary_id}) then class/department get saved as expected.
e
I assume the subsidiary is set before the other two values
Are you in dynamic mode?
a
right, if you're in dynamic mode you would need to reset some values, or just set subsidiary first... if you're not in dynamic mode...I have no idea what's happening.