- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2024 03:12 AM - edited ‎02-21-2024 03:29 AM
Hi everyone is there any way to make a GlideRecord that will get the table of the current record with a BR ?
Basically what Im trying to do is:
We have a field in the record producer that has a default value with will populate a field on the table, but when this default value changes we want all the previous records that have been created with the old value change to the new one, the problem is that this field exist's in many tables, so I need to get the table of the record that the default value got changed.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2024 03:41 AM
Hi,
You can use GlideElement class method getTableName() in order to return the name of the table on which the field resides.
For example:
if (current.approver.getTableName() == "sysapproval_approver"){ //Example to use getTableName() method
return true;
}
Refer to this link for more information on the method - GlideElement | ServiceNow Developers
Thanks,
Manik Modi
Please mark my reply as the solution if you find this helpful. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2024 03:30 AM
If possible can you provide some more information please...
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2024 03:41 AM
Hi,
You can use GlideElement class method getTableName() in order to return the name of the table on which the field resides.
For example:
if (current.approver.getTableName() == "sysapproval_approver"){ //Example to use getTableName() method
return true;
}
Refer to this link for more information on the method - GlideElement | ServiceNow Developers
Thanks,
Manik Modi
Please mark my reply as the solution if you find this helpful. Thanks!