File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ // Description : This macro syntax GlideRecord the specific table to retrieve and process child records from that table
2+ // Modify parent_sys_id, 'table_name',parent_reference_field_name according to your requirement
3+
4+ // code
5+ var parent_sys_id = 'parent_sys_id' ; // parent sys_id
6+ var childRecord = new GlideRecord ( 'table_name' ) ; // Glide record the table
7+ childRecord . addQuery ( 'parent_reference_field_name' , parent_sys_id ) ; // filter the record according to parent sys_id
8+ childRecord . query ( ) ; // query the table
9+ while ( childRecord . next ( ) ) {
10+ gs . info ( " Child Record Number " + childRecord . getValue ( 'number' ) ) ; // child record number
11+ gs . info ( " Child Record Short Description " + childRecord . getValue ( 'short_description' ) ) ; // child record short description
12+ }
13+
14+ // Example
15+ var parent_sys_id = 'a623cdb073a023002728660c4cf6a768' ; // parent sys_id
16+ var childRecord = new GlideRecord ( 'incident' ) ; // Glide record the incident table
17+ childRecord . addQuery ( 'parent_incident' , parent_sys_id ) ; // filter the record according to parent sys_id
18+ childRecord . query ( ) ; // query the table
19+ while ( childRecord . next ( ) ) {
20+ gs . info ( " Child Record Number : " + childRecord . getValue ( 'number' ) ) ; // child incident record number
21+ gs . info ( " Child Record Short Description : " + childRecord . getValue ( 'short_description' ) ) ; // child incident short description
22+ }
You can’t perform that action at this time.
0 commit comments