0

I have a couple questions. The logic is

IF Opp Status is not Closed

AND

Close Date is Current Fiscal Quarter,

THEN

Value of Field ”Probability to Close this quarter“ cannot be “none”

AND
DATEVALUE(CloseDate,"Current FQ")
AND( 
ISPICKVAL(StageName,"Closed Won"), 
ISPICKVAL(StageName,"Closed Lost")),
ISNULL(Probability_To_Close_This_Q__c))

1) Does this work: DATEVALUE(CloseDate,"Current FQ")?

2) It can be either Closed Won OR Lost, there should be an OR someplace?

Thanks!

0

If I'm understanding this correctly, you need something like this. If your company uses custom fiscal quarters, you'll need to adjust to account for that. If all conditions are true, the error would be thrown.

Keep in mind also that this will only check when the opportunity is edited and will not be a real-time indicator of opportunities that would otherwise meet the criteria.

AND(
    /*Check that the year of the close date is the same as today's year*/
    YEAR(TODAY()) = YEAR(CloseDate),

    /*Check that calendar quarter of close date is the same as today's calendar quarter */
    CEILING(MONTH(TODAY())/3) = CEILING(MONTH(CloseDate)/3),

    /*Check that Stage is not Closed Won or Closed Lost*/
    NOT(
        OR(
            ISPICKVAL(StageName,"Closed Won"),
            ISPICKVAL(StageName,"Closed Lost")
        )
    ),

    /*Check that Probability_To_Close_This_Q__c is blank*/
    ISBLANK(Probability_To_Close_This_Q__c)
)

****EDIT****

If Probability_To_Close_This_Q__c is a picklist, and you want to use a contains operator on StageName, you can try the following.

AND(
    /*Check that the year of the close date is the same as today's year*/
    YEAR(TODAY()) = YEAR(CloseDate),

    /*Check that calendar quarter of close date is the same as today's calendar quarter */
    CEILING(MONTH(TODAY())/3) = CEILING(MONTH(CloseDate)/3),

    /*Check that Stage is Closed*/
    CONTAINS(TEXT(StageName),"Closed"),

    /*Check that Probability_To_Close_This_Q__c is blank*/
    ISBLANK(TEXT(Probability_To_Close_This_Q__c))
)
  • Check this doc for simpler way to find which quarter a specific date is in, you may not need to year/ month check instead do a simple quarter( today) = Quarter( closedate) check : help.salesforce.com/apex/… – Rao May 12 '16 at 18:02
  • Thanks for all your detail, i will try this and let you know :) – Andy Ux May 12 '16 at 18:39
  • The company uses regular FQ, does that make a difference? – Andy Ux May 12 '16 at 23:14
  • Error: Field Probability_To_Close_This_Q__c is a picklist field. Picklist fields are only supported in certain functions. – Andy Ux May 12 '16 at 23:19
  • Can we use something like TEXT(StageName, "Closed Won"), etc.. or CONTAINS "Closed" – Andy Ux May 12 '16 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.