function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lakshmi SLakshmi S 

trigger scenario

Hi All,

Q). One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff.
   Write a trigger that should calculate the sum of 3 tasks.  And if any task is modified than trigger should fire automatically & perform the same.


Can any one reply for this post..
Thanks in advance
 
Harish RamachandruniHarish Ramachandruni
Hi,

Are u craeted field of discount .

Regards,
Harish.R
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for trigger
1) http://amitsalesforce.blogspot.com/2016/09/collection-in-salesforce-example-using.html

Please check below post for rollup field by trigger
1) http://blog.jeffdouglas.com/2009/07/30/roll-up-summary-fields-with-lookup-relationships-part-1/
2) https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries

Just modify your trigger wil above post. If you found any error please post  your code here we will help you
Ajay mishraAjay mishra
Hi Laxmi,

You need to create a Trigger on Task which will be on After Insert & Update.

Then if insert just simply sum the all taks discount and Update on Parent Object.

Else if Update check wheather the old and new value are changed. on that basis update the Parent Object.

Please let me know, if you have any other question.

Regards,
Ajay Mishra