How to get Old values and populate in Target record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:49 PM
Hi Team,
I'm trying to re-populated 4-field of old values in INC record( Resolved by, Resolved , Summary of Resolution ), so I'm trying to Query sys_history_line table and INC table
how Query, how to populated old values into Respective INC Target fields from sys_history_line.
Please help with some sample code here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 06:00 AM - edited 05-01-2024 06:01 AM
Hi @Supriya25 ,
If you need just the before populated value, you can use previous in BR right?
current.resolution_code = previous.resolution_code;
Something like this might work.
Please mark my answer correct/helpful if it resolved your query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 06:21 AM
but if we use BR we have to go each record and update right .
at client environment we have 200+ records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 07:35 AM
You want to run for existing records?Then you should write your code on sys_audit table.
But if you want to go on a much easier route i would recommend you to call the business rule from scheduled job.
Steps will be:
1)Write the business rule with your required logic.
2)Call the business rule from scheduled job:
-Navigate to 'System Scheduler -> Scheduled Jobs' and create new and call it
-You can Refer 'Autoclose Incidents' scheduled job
3)Run the scheduled Job only once (or till your job is done)
4)If you want the BR to be used for new records keep it or else deactivate the BR after you have updated them.
Please mark my answer correct/helpful if it resolved your query