Does submitFields not include all fields on a reco...
# suitescript
s
Does submitFields not include all fields on a record when the userEvent script is triggered? I have a beforeSubmit, but when I log the info, the only field that has a value is the fields that were submitted. Also noticed that getFields() only returns a few fields, instead of all of them
Copy code
[
   "custbody_mes_select_card_on_file",
   "debitcardissueno",
   "e",
   "ccexpiredate",
   "ccpanid",
   "singleparam",
   "sys_id",
   "_submit_field_mode",
   "shippingcostoverridden",
   "customercode",
   "validfrom",
   "id",
   "ccname",
   "ccnumber"
]
m
Nope. SubmitFields only includes the fields that were updated as part of the submit in the
newRecord
object. I believe the
oldRecord
object contains the entire record.
b
sadly ss1 remains the best documentation on the subject: Inline Editing and SuiteScript
👍🏼 1
s
That's so poorly designed. If it's not going to include all fields, it shouldn't trigger user event scripts. Because it doesn't include all fields, then user event scripts will perform incorrectly
b
yup, its one of the most common issues with xedits: user event scripts that dont correctly filter their types or have logic to handle xedits
👍🏼 1
s
Whoops, didn't mean to post my reply in #suitescripts lol
Is there an easy way to handle submitFields? Is there a context type?
b
you would use context.type if you just wanted to filter it out
e
submitFields
is an inline edit, so the
type
will come in as
XEDIT
👍🏼 1