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
tklinetkline 

Request Close - button & process

Hey guys-

 

I just pulled a formula from Salesforce's "Useful Validation Formulas" .pdf but I'm having some trouble.

 

I'm currently writing a validation rule that would require Sales Reps and Account Managers to click a button called "Request Close" before they can set an opportunity as Closed Won.  When they click the button, it would send out an email to myself and an additional sales manager to verify that the proper documents are attached to the opportunity.  We would than mark the opportunity as Approved and it would close.

 

Here's essentially what I would like to set up:

 

A custom button on opportunities that would send to a specific email address (the email template id is 00XA0000001Nlp7) of a manager.

 

I found this code but it relates to cases, not opportunities:

 

location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=<yourtemplate here>&p5=&save=1');

 

 

However here is where it gets alittle complicated.  We have two offices, one in Arizona and one in New York.  We only need this rule setup for the NY office- the Arizona office uses a different process. Here is the formula so far:

 

ISPICKVAL(StageName , "Closed Won"),

NOT ( ISPICKVAL ( Approval_Status_C , "Approved")

 

What would be the best way of differentiating between the two different offices?  The roles are the same across the company, so I'm not sure how I can specify this.  Any input is GREATLY appreciated.  Thanks guys.

 

 

 

Ritesh AswaneyRitesh Aswaney

You could have a field on the Opportunity (maybe hidden, not on the pagelayout), say OpportunityLocation__c, which is set to either NY or Arizona, depending on where the Opportunity originated.

 

Then the validation rule could factor in this field before setting the status to Closed.