Hii Everyone!! I have to create a custom checkbox field in account. when the field is true and saved, all its related opportunity should have stage=Closed won and its amount should not be blank. I tried this using apex triggers. Its not working.
We can achieve this by using two triggers: 1) Trigger On Account (After insert, after update) : Here you can check for condition of your check box 2) Trigger on Opportunity (Before insert, Before Update): here you can check for Stage Name and empty Amount field. If Amount field is empty then we can just change Amount to Zero.
Regards,
Ramakant
All Answers
We can achieve this by using two triggers:
1) Trigger On Account (After insert, after update) : Here you can check for condition of your check box
2) Trigger on Opportunity (Before insert, Before Update): here you can check for Stage Name and empty Amount field. If Amount field is empty then we can just change Amount to Zero.
Regards,
Ramakant
The amount field should not be blank. How to do this?
How to change Amount field to zero when its empty?? Thanks in Advance!!
Regards,
Ramakant
"Method does not exist or incorrect signature: void isEmpty() from the type Decimal". This is the error I'm getting!!
This worked for me!! Thank You for your help!!