You need to sign in to do that
Don't have an account?
Formula Field with CASE operator
I have a Formula field named "Net Amount" (below is the formula for that)
based on record type I need to calcuated the "Net Amount"..
CASE ($RecordType.Name ,
"US Opportunity", Amount__c*0.62,
"US Jobber Opportunity", Amount__c*0.62,
"Authentication", Est_Opportunity_Volume__c*Est_Selling_Price__c,
"US Opportunity - Approved", Amount__c*0.62,
"US Free Goods Opp" , Amount__c*0.62,
"US Free Goods Opp - Approved" , Amount__c*0.62,
"US Lost Account" , Amount__c*0.62,
"AUS Record Type" , Amount__c * 12,
"US DuPont Legacy Opportunity" ,Amount__c * 0.62,
"DPC-AP" ,Amount__c * 12,
"IND-AP" , Amount__c / Contract_Duration__c,
0)
Everthing works fine until "Contract_Duration__c" is not 0 (zero) or NULL
Even if the incoming RecordType not equal to "IND-AP" and "Contract_Duration__c" is null or 0
the result is #Error!
Requesting to please help me out how to set this..
as if the recordType not equal to "IND-AP" things should work...
thanks in advance
Sunny
Try with the below code.
CASE ($RecordType.Name ,
"US Opportunity", Amount__c*0.62,
"US Jobber Opportunity", Amount__c*0.62,
"Authentication", Est_Opportunity_Volume__c*Est_Selling_Price__c,
"US Opportunity - Approved", Amount__c*0.62,
"US Free Goods Opp" , Amount__c*0.62,
"US Free Goods Opp - Approved" , Amount__c*0.62,
"US Lost Account" , Amount__c*0.62,
"AUS Record Type" , Amount__c * 12,
"US DuPont Legacy Opportunity" ,Amount__c * 0.62,
"DPC-AP" ,Amount__c * 12,
"IND-AP" , IF((ISBLANK(Contract_Duration__c) || Contract_Duration__c == 0 ), 0, Amount__c / Contract_Duration__c),
0)
All Answers
Try with the below code.
CASE ($RecordType.Name ,
"US Opportunity", Amount__c*0.62,
"US Jobber Opportunity", Amount__c*0.62,
"Authentication", Est_Opportunity_Volume__c*Est_Selling_Price__c,
"US Opportunity - Approved", Amount__c*0.62,
"US Free Goods Opp" , Amount__c*0.62,
"US Free Goods Opp - Approved" , Amount__c*0.62,
"US Lost Account" , Amount__c*0.62,
"AUS Record Type" , Amount__c * 12,
"US DuPont Legacy Opportunity" ,Amount__c * 0.62,
"DPC-AP" ,Amount__c * 12,
"IND-AP" , IF((ISBLANK(Contract_Duration__c) || Contract_Duration__c == 0 ), 0, Amount__c / Contract_Duration__c),
0)