You need to sign in to do that
Don't have an account?
Frank Bassillo
Way to make sure Account Managers attach necessary documents?
Hey Everyone,
I was just wondering if anyone knew of a way to make it sure Account Managers attach any required documents once an oppotunity is changed to "closed"
I figured I could just create a process to send out an email alert, but I was wondering if anyone knew of any more effective methods.
You can add trigger to validate presence of attachments before closing the opportunity.
Below is a sample code.
trigger tgrOpportunity on Opportunity (before update)
{
List<Opportunity> lstOpp = [select id,(select id from Attachments) from Opportunity where id in : Trigger.New];
for(Opportunity o : lstOpp)
{
if(Trigger.NewMap.get(o.id).isclosed && o.Attachments.size() ==0)
{
Trigger.NewMap.get(o.id).adderror('Please add an attachment before closing the opportunity.');
}
}
}
Please mark this as best answer if this helps.
Regards
Akhil Tandon