All, I've run into an issue in two production acco...
# suitescript
s
All, I've run into an issue in two production accounts and two sandbox accounts related to searching for a multi-select field value via a join. Unclear how widespread this issue is, but if anyone could try this out in a non-dev/test drive account it would be appreciated. Seems like a potential impact to any scripts out there, but it's unclear how widespread this issue is. Trying to get NS to raise the priority of this defect.
Here's the scenario:
Two custom record types. One of the record types references the other via a list/record field. The "parent" record type has a multi-select field.
message has been deleted
message has been deleted
b
too much work, make something that can be uploaded via sdf
and hopefully reproduced
s
Yeah good idea
I'll list the steps here anyways
Then, create two records for the parent (e.g. internal id 1 and 2) each with different values in the multi-select field. Then, create a record for the child (internal id 1) and reference the parent (internal id 2) --- the internal ids are important here.
Then, run this search:
require(['N/search'], function(search) {               console.log(                              search.lookupFields({                                             type: 'customrecord_ns_defect_child',                                             id: 1,                                             columns: ['custrecord_parent_record.custrecord_parent_field']                              })               ); });
You would expect to get the value stored in the parent's (internal id 2) multi-select field.
however, it returns the value from the other parent record
non-multi-select fields work as expected
The same unexpected results also happen when running a search via search.create via suitelets and map reduce scripts (apparently user event scripts are immune to this behavior)
Here's an SDF project with the two custom records
b
your reproduction steps are missing setting the sample fields on the parent
you may actually want to try including the instances in the sdf object files
s
Here's a version of the project with records included
Simply install and then run this via your browser console:
require(['N/search'], function(search) {               console.log(                              search.lookupFields({                                             type: 'customrecord_ns_defect_child',                                             id: 1,                                             columns: ['custrecord_parent_record.custrecord_parent_field']                              })               ); });
If not impacted by the defect you should see:
message has been deleted
b
message has been deleted
s
thanks for trying!
b
it is now however easy to test
s
yup
Here's what you don't want to see:
message has been deleted
This has been filed as defect 630277