How to create a History of status changes for a Record. (Adding multiple updates of same Record)

Certified Associate Developer

Hello.

I have a process where i want to monitor status of a Record and to save the details about each step with timestamp.

Lets say i have 3 statuses:

Id 1 "it started"

Id 2 "first mail"

Id 3 "second mail"

And I have Record type "History" with columns

Id(primary key), status id, timestamp. I want this Record type to save the data like:

Id1, status id1, 23.12.2022 12:55:00

Id1, status id2, 23.12.2022 12:57:00

Id1, status id3, 23.12.2022 12:59:00

Id2, status id1, 23.12.2022 13:01:00

And so on...

So i can see the precise time when each step occured without overwriting Id1 with last status3 (and only showing this last status on database/Record type).

How can I achieve this?

Currently I'm saving the status id with Script task, but dont know where to tell Process Model that I want to save each step separately. And as i complete the process IT only shows last status on database.

Help will be much appreciated.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to marcinc6607

    i have solution with that as well , instead of trigger you can create a table which says t_history .. and must have same schema as your main table but the additional fields can be history modified by and history date and history id as PK . Always write a new enter in history table as soon as you dump a new entry or update in the main table . this way you can maintain it .

    Also,

    if the use case is just up to the process level you can use a temporary CDT with the same structure as mentioned above for t_history and always append a new row in it as soon as there is an update or new row in you main CDT and you can pass the temporary  cdt through out your process wherever needed