BPM Method Directive Store Previous Value

Hello,

I created a Pre-Processing directive that sends an email notification when the JobHead Required Due Date changes.

image

It works, but I have a problem with a requirement. The email should contain the old and the new date.

I created a variable to store the old date, but it is not working. Once the email is sent, the old and new date are the same, both have the new date.

How can I store the old date and then use it in the email?

Thanks.

You’re going to want to store the old date in a local variable and reference the new date (hint: Updated Row) and display the local variable and the new date in the email

@Aaron_Moreng

This is what I got:
I created a variable named PreviousReqByDate and set the value with the dsJobHeadRow.ReqDueDate.

I set the value here by clicking on the Action link:

However, the old date is not there. Only the new date.

Thanks.

Store the old data in pre processing in a callcontex field

@josecgomez

I stored the date in a callcontext field like this, one for the dsJobHeadRow and one for the ttJobHeadRow:

However, I still can’t get the old date. Both fields contain the new date. Am I doing it right?

Thanks.

You have to pull the OLD date out of the database, you can’t assign it form the ttTable.

2 Likes

So in your Specify Expression Window, replace dsJobHeadRow.ReqDueDate with this

(from x in Db.Jobhead where x.Company == dsJobHeadRow.Company && x.JobNum == dsJobHeadRow.JobNum select x.ReqDueDate).FirstOrDefault()
1 Like

Thank you all.
I created the query and retrieve the old value. Everything is working now.

Thanks again.

1 Like