juansalas
(Juan Salas)
February 20, 2019, 10:52pm
1
Hello,
I created a Pre-Processing directive that sends an email notification when the JobHead Required Due Date changes.
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
juansalas
(Juan Salas)
February 20, 2019, 11:11pm
3
@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.
josecgomez
(Jose C Gomez)
February 21, 2019, 12:26am
4
Store the old data in pre processing in a callcontex field
juansalas
(Juan Salas)
February 21, 2019, 2:34pm
5
@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.
josecgomez
(Jose C Gomez)
February 21, 2019, 3:53pm
7
You have to pull the OLD date out of the database, you can’t assign it form the ttTable.
2 Likes
josecgomez
(Jose C Gomez)
February 21, 2019, 4:07pm
8
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
juansalas
(Juan Salas)
February 21, 2019, 4:44pm
9
Thank you all.
I created the query and retrieve the old value. Everything is working now.
Thanks again.
1 Like