Is there a way to get Previous value of a field in Scheduled job scripts.

Thummala_Murthy
Kilo Contributor

HI Friends,

Is there a way to get Previous value of a field in Scheduled job scripts.

i know we can use predefined variable previous in BR which i can not use it in scheduled job scripts.

i have a workflow that sets a field to null value and after a month duration it should hold the previous value.

i had written a scheduled job to query the table and all records to set that field value.

i am facing a challenge in setting the field to previous value from null.

is there a way to read the field value return with old values.

pls suggest or help me.

Thanks

Murthy

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

Hi Murthy,



As you rightly mentioned that previous and current objects are not available Jobs.


What you can do here is query the sys_history_line table, this table hold the old and the new value of the fields.



NOTE: this table is really really huge and query to this table is a real threat to the performance.



Let me know if you need any further info on this.


-Anurag

Thummala_Murthy
Kilo Contributor

Thanks Anurag... it really helps me with this info.


and do you know when this table will be updated(will it take some time to update/ is there any scheduler that runs and updates this table)


i am not seeing the changes immediately.



tx


Murthy


whenever the data updates this table is updated.


change the value of any field and save the form. Now on your form click on the related link   "show history", now apply filter on the label to track the change you made and you will see the old value, new value and also order.


-Anurag