HI All
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:21 PM
HI All,
i have two tables
1.dms_document
2.dms_document_revision
i need fetch the field value(update date) dms_document_revision to dms_document .
Please any one suggested
ADV Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:24 PM
and where you will store this value in other table, other table also has same field name.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:11 PM
no different name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:20 PM
Hi @basha shaik
(function executeRule(current, previous /*undefined*/, action) {
// Define the document_id
var documentId = current.document_id;
// Create a GlideRecord object for the dms_document_revision table
var revisionGR = new GlideRecord('dms_document_revision');
// Query to get the latest update_date for the given document_id
revisionGR.addQuery('document_id', documentId);
revisionGR.orderByDesc('update_date'); // Order by the latest update_date
revisionGR.setLimit(1); // Only get the most recent revision
revisionGR.query();
// Check if a result is found
if (revisionGR.next()) {
var latestUpdateDate = revisionGR.update_date;
// Now, update the dms_document table with the latest update_date
current.update_date = latestUpdateDate;
current.update(); // Save the changes to the dms_document record
}
})(current, previous);
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************