- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2022 09:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 02:08 AM
You need to add some query if you want to update existing record.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('u_table_1');
gr.addQuery(); // eg. gr.addQuery('fieldName', 'value');
//gr.addQuery('active', true); // eg
gr.query();
//gr.insert(); // use this line if you want to create new record
while(gr.next()){
gs.log(gr.u_table_2); // here use gr.fieldName
gr.fieldName = 'value';
gr.update(); // to update the record matching your query.
}
})(current, previous);
Note: replace fieldName as per your column/field names in your tables.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 08:41 AM
script of relationship is not working
configure related list is not show a parent linked on table 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 09:59 AM
This is tested in my PDI and is working correctly. Please share the screenshot of what you have configured , there might be a step which you have missed and hence not getting the result.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 03:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 09:16 AM
Hi,
Just posting a script will not help you. You need to share the screenshot of the Tables which you have configured.
Also on which Table you have written your Rule is a factor here to decide if your query is correct or not.
I have very clearly mentioned step by step on how to achieve what you are looking for. Have you read what I have posted above?
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2022 09:30 PM
yes sir. it worked.
Update Short Description of a particular record of Table2 whenever a record is updated in Table1.
this is my code is this right or not?
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var rec = new GlideRecord('u_table2');
//rec.addQuery('u_string_3',current.sys_id);
rec.query();
while(rec.next())
{
rec.u_string_3 = current.u_table_1;
rec.update();
}
})(current, previous);