You need to sign in to do that
Don't have an account?

Automatic Schedule set-off Amount Trigger
Hi all,
Please help me to write a Trigger.
In Opportunity i have a related list Schedule
It shows(has) three fields:-
Total Receipt Amount Realized - Curreny field, it rollups all the receipts by trigger( this is done)
Installement Basic Value - Currency field
Total Amount Setoff - formula field (Total Amount Realized -Installement Basic Value)
Here i want to write a Trigger it should work as below
I have three records in Schedule it shows
Schedule NameTotal Receipts Realized Installement Basic Value Total Amount Setoff
On Booking 20000 10000 10000
Agreement Signing 20000 5000 15000
Excavation 20000 5000 15000
For first record (On Booking) Total Amount Setoff is calculating correctly i.e., 20000-10000=10000
For second record (Agreement Signing) it should take the first records (On Booking) Total Amount Setoff and it should deduct from Installement Basic Value and it should give the Total Amount Setoff in second record Amount as 10000-5000=5000.
The Result should be below mentioned
Schedule Name Total Receipts Realized Installement Basic Value Total Amount Setoff
On Booking 20000 10000 10000
Agreement Signing 20000 5000 5000
Excavation 20000 5000 0
Thanks in advance.....