Rick Goodrow
06/05/2024, 6:01 PMN/record.load()
on the customer ID when it's selected, or create a simple saved search with one result column of the zip code, then run that saved search with the customer ID as the filter? I know a N/record.load()
is resource intensive because it will trigger other things, but creaing a saved search just for a single value off a customer record seems superflousEdgar Valdes
06/05/2024, 6:04 PMsearch.lookupFields
that doesn't load the customer
I wonder if after selecting the customer... is not an address field in the SO that gets populated after sourcing the customer?erictgrubaugh
06/05/2024, 6:04 PMMichael Pope
06/05/2024, 6:11 PMsearch.lookupFields()
is a good option as @Edgar Valdes says. It uses N/search
in the background, which is slightly less intensive than N/record
. Of course, loading the record isn't that much slower either - so I wouldn't worry about this enormously. (2) As @erictgrubaugh said, customers can have many addresses - shipping, billing, and then there's the ones in the address list. I'm not sure search.lookupFields()
will work on the ones in the address list that are not the shipping and billing address. (3) You also need to prepare for the scenario of there not being a zip. Addresses can be entered in a freeform 'Custom' way, if a user selects that specific check mark that's on the right side of the address record. If they do that, they sometimes leave the zip field blank. You'll need to train your users or use a script to force them to not do this (and you can use a search to lookup and see if any addresses are currently in this state).Edgar Valdes
06/05/2024, 6:21 PMsearch.lookupFields()
over record.load()
for simple field retrieval because sometimes, somewhere, a record can be locked by a workflow. This lock prevent the load, but not the lookup (or the search/query if thats the case).
The SO has billzip
and shipzip
, but not sure when are those fields available for the scripts (after customer sourcing, after address re-select, before submit, after submit, etc)Rick Goodrow
06/05/2024, 6:25 PM.load()
would trigger unecessary workflows. I will experiment with the .lookupFields()
and getting zip from primary shipping address (yes, I have code for missing values)raghav
06/05/2024, 6:52 PMRick Goodrow
06/05/2024, 7:21 PMN/record.load()
to get the data I was looking for was bad practice.battk
06/05/2024, 8:22 PMbattk
06/05/2024, 8:23 PMRick Goodrow
06/05/2024, 8:28 PMbattk
06/05/2024, 8:31 PM