You need to sign in to do that
Don't have an account?
Ramesh Malkagiri 2
Hi All
I would appreciate any help with the above scenario, Attached are the screen shots of the scenario.
The situation is :
I have created a Master-Detail relationship from Lab object to Student Object, where student is the Master and lab is child.
On student object i created a rollup summary field called "Lab Absent"
My workflow rule is (Whenever a student is absent for the lab for 2 consecutive days, the "Lab absent" field on student object should update and automatically send an email to the faculty).
******** The problem we have is ---- when the student returns on the third day and is marked present on the "Lab Object"
The "Lab Absent" field on student object doesn't change the value back to zero and it is still sending an email that the student is absent.
Please advise solution for the above problem and if there is any issues with my logic.
Note: the above situation doesn't involve any coding, its purely using Admin. If there is any coding required please advise the code.
Regards
Ramesh
Field Update for Rollup Summary
Hi All
I would appreciate any help with the above scenario, Attached are the screen shots of the scenario.
The situation is :
I have created a Master-Detail relationship from Lab object to Student Object, where student is the Master and lab is child.
On student object i created a rollup summary field called "Lab Absent"
My workflow rule is (Whenever a student is absent for the lab for 2 consecutive days, the "Lab absent" field on student object should update and automatically send an email to the faculty).
******** The problem we have is ---- when the student returns on the third day and is marked present on the "Lab Object"
The "Lab Absent" field on student object doesn't change the value back to zero and it is still sending an email that the student is absent.
Please advise solution for the above problem and if there is any issues with my logic.
Note: the above situation doesn't involve any coding, its purely using Admin. If there is any coding required please advise the code.
Regards
Ramesh
You need to update WF enntry criteria to "Everytime record is created and updated".
Ideally, you should be creating a Rollup field on Student object which will Count only those records where you have Attendance__c = 'Absent'.
This should solve your problem.
Goal:
Need to reset the "Lab Absent" rollup summary field to - 0
Solution:
- Add one more picklist value in "Attendance" field like Absent Email Sent
- Add one checkbox field(internal user only) like "Send Absent Email", update that checkbox to true from your existing workflow
- Write trigger on Lab object, which will execute only that "Send Absent Email" checkbox is true. Now in trigger you need to get all Lab records(With Attendance = Absent) of its student record and update all those lab records to Attendance field value to "Absent Email Sent". As well as reset that checkbox flag to false.
- So now, after your workflow executes and after email sent you have no any lab which have "Absent" value exist so rollup summary field(Lab Absent) have value 0 and it would not send email again.
Below is trigger, Please try.
May be you need to update object and field api names
Send_Absent_Email__c - API name of new checkbox field
Let me know if any issue.
Thanks & Cheers,
Jigar
Thanks for your reply.
I have tried the above but getting incompatible key type error.
I have attached the screen shot could you please advise
Regards
Ramesh
Please update below line With
Thanks & Cheers,
Jigar (pateljb90@gmail.com)