Using SuiteQL, is there a way to tell all custom r...
# suiteql
j
Using SuiteQL, is there a way to tell all custom records types that are Child Records of another custom record type? I can retrieve a list of custom fields on custom records where the TYPE of the field is the parent custom record type, but that won’t tell me if
RECORD IS PARENT
is ticked. Use Case: when copying a parent record, I want a generic way to identify all sublists of child records, and copy those also.
I think I can achieve this w/SS by doing a record.create then iterating through getSublists() looking for which ones start w/ ‘recmachcustrecord’
c
Beat me to it 😄
@jen Or you can load the custom record type itself and look at the
children
sublist
j
there’s a
children
sublist?
TIL
c
Me too 😄
poke and prod
Something like this
j
i can’t find a sublist with sublistId: ‘children’
am I being dense
c
You're able to load the custom record using the custom record's numeric internal ID?
j
yes
Copy code
var ws = record.load({type: 'customrecord_applications', id: 50679});

// This seems to be null
ws.getSublist({sublistId: 'children'});
c
What I mean is: load a record of type "customrecordtype" with the internal ID that corresponds to the custom record type "customrecord_applications"
j
ohhh
this is what happens when I try to figure this out while in a teams meeting
c
also, there's a lot of types of records and records of types and internal IDs of things - the possibilities are endless
j
boo yah
it works
THANK YOU
c
de nada! Glad it's of use