Skip to main content
Chris Becker a posé une question dans #Formulas
I'm new to Salesforce and I am trying to create a formula that will look at two variables and determine a cost percentage.

Field 1 is a status (picklist) and Field2 is either null or Available(picklist). For Statuses PROC & UNCO the second variable isn't needed - only for the EXIS status.  The cost percentage is then based on either the one variable or the combination and I used CASE function to determine the percentage that goes into Field3. 

The formula works great for anything in PROC or UNCO status - but nothing happens if it is in EXIS status. Any suggestions will be greatly appreciated.

IF( ISPICKVAL(Account.Field1_Status_NA__c, "PROC") ,

CASE(Account.Field3_NA__c,"A", 15/100,"B",20/100,"C",20/100,"D",20/100,"E",25/100, "F",25/100,"G", 30/100,0),

IF(ISPICKVAL(Account.Field1_Status_NA__c, "UNCO") ,

CASE(Account.Field3_NA__c,"A", 15/100,"B",20/100,"C",20/100,"D",20/100,"E",25/100, "F",25/100,"G", 30/100,0),

IF(AND(ISPICKVAL(Account.Field1_Status_NA__c, "EXIS") , ISPICKVAL( Account.Field2__c, " ")) ,

CASE(Account.Field3_NA__c,"A", 10/100 ,"B",15/100, "C",15/100,"D",15/100,"E",25/100, "F",25/100,"G", 0,0),

IF(AND(ISPICKVAL(Account.Field1_Status_NA__c,"EXIS"), ISPICKVAL( Account.Field2__c, "Available" )),

CASE(Account.Field3_NA__c,"A", 5/100,"B",10/100,"C",10/100,"D",10/100,"E",15/100, "F",15/100,"G",0, 0), Null) ) ) )

 
9 réponses
  1. 1 mars 2016, 23:00

    IF(OR(ISPICKVAL(Account.Field1_Status_NA__c, "UNCO"), ISPICKVAL(Account.Field1_Status_NA__c, "PROC") ),

    CASE(Account.Field3_NA__c,"A", 15/100,"B",20/100,"C",20/100,"D",20/100,"E",25/100, "F",25/100,"G", 30/100,0),

    IF(ISPICKVAL(Account.Field1_Status_NA__c, "EXIS") ,IF(ISPICKVAL( Account.Field2__c, "Available") ,CASE(Account.Field3_NA__c,"A", 5/100,"B",10/100,"C",10/100,"D",10/100,"E",15/100, "F",15/100,"G",0, 0),

    CASE(Account.Field3_NA__c,"A", 10/100 ,"B",15/100, "C",15/100,"D",15/100,"E",25/100, "F",25/100,"G", 0,0)), null))

0/9000