You need to sign in to do that
Don't have an account?
Not Allow to change Opportunity Stage if previous stage has open tasks
Hi,
The system should not allow me to change the Opportunity stage if the previous opportunity's stage related task is not completed.Task status should be equal to complete.
Write Before Trigger on Opportunity and take count by query in that where condition would be taskstatus = "open"..
if count is greater than 1 then addError that "some tasks are already open"
please find updated code below which will work for both New and Update Opportunity: Hope this helps.
Please mark this as solved if the information helps so that it gets removed from the unanswered queue which results in helping others who are encountering similar issue.
Best Regards,
Nagendra.
Hi Prithviraj and Nagendra,
I tried what you explained Prithviraj but didnt get my output.
and Nagendra, your code working fine whenever I am creating and updating opportunity record, but when some of my record gets updated by approval process then its giving error "Attempt to de-reference a null object".