scottvonduhn
07/15/2022, 2:26 PMamountremainingtotalbox
This is slowing things way down for us. So, the question is, is there some reason that value can’t be retrieved from newRecord directly? Is there a more efficient way to get the same value? The record load is almost doubling our invoice save times. The developer no longer works for NetSuite, as of a week or two ago, so we can’t even question that person about it now.
Here is the beginning of the code:alien4u
07/15/2022, 2:48 PMalien4u
07/15/2022, 2:53 PMcontext.newRecord
)`scottvonduhn
07/15/2022, 2:54 PMalien4u
07/15/2022, 2:55 PMscottvonduhn
07/15/2022, 2:58 PMscottvonduhn
07/15/2022, 3:00 PMDiderik
07/15/2022, 3:27 PMamountremainingtotalbox
is not available as a search column. So something like
search.lookupFields({type: "invoice", id: rec.id, columns: "amountremainingtotalbox"});
would result in a SSS_INVALID_SRCH_COL error.
Also, in afterSubmit newRecord only contains the values that have changed on the record, the others are empty.
Since you said this is only for a customers with open customer payments you could consider checking if said customer has open customer payments and returning before loading the invoice if they dontscottvonduhn
07/15/2022, 3:40 PM