How to get Old values and populate in Target record

Supriya25
Tera Guru

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.

7 REPLIES 7

Ramz
Mega Sage

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

but if we use BR we have to go each record and update right .
at client environment we have 200+ records.

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