You need to sign in to do that
Don't have an account?
MarkInAtlanta
Newbie Apex calculation question
Looking in a calc heavy apex class i inherited. Probably a newbie question but.. I see this form alot in the class:
SumCurrentSalesValueB = SumCurrentSalesValueB + (line.Current_Sales_Value__c != null ? Integer.ValueOf(line.Current_Sales_Value__c):0);
I assume the use of "Line.Current_Sales_Value__c != null ?" is basicly a test with the ":0)" the replacement value if true? Seems to do that.
I looked high and low thru the Apex doc - can anyoue point me to the correct reference for this..
SumCurrentSalesValueB = SumCurrentSalesValueB + (line.Current_Sales_Value__c != null ? Integer.ValueOf(line.Current_Sales_Value__c):0);
I assume the use of "Line.Current_Sales_Value__c != null ?" is basicly a test with the ":0)" the replacement value if true? Seems to do that.
I looked high and low thru the Apex doc - can anyoue point me to the correct reference for this..
eg:
( age <30)? young: old means
if(age < 30)
{
young
}
else
{
old
}
refer Trenary operator in this article https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_expressions_operators_understanding.htm
All Answers
eg:
( age <30)? young: old means
if(age < 30)
{
young
}
else
{
old
}
refer Trenary operator in this article https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_expressions_operators_understanding.htm