You need to sign in to do that
Don't have an account?
Cory Iler
Formula to display actual value if not null but if null display text
So I have a field called "Days Since Last Order." Pretty basic formula field:
TODAY() - LastOrderDate__C. This works perfect and gives me the days.
But what is happening is if the customer has never ordered it shows 0 as if they just ordered today. I need this field, if the LastOrderDate__c is null to display "NEVER" but if there is a value to display the number.
TODAY() - LastOrderDate__C. This works perfect and gives me the days.
But what is happening is if the customer has never ordered it shows 0 as if they just ordered today. I need this field, if the LastOrderDate__c is null to display "NEVER" but if there is a value to display the number.
Salesforce fields don't change types.
You would have to have a TEXT type and use the formula
IF(ISBLANK(LastOrderDate__c), 'NEVER', TEXT(TODAY() - LastOrderDate__C))
that would return a String value instead of a number
if you are talking about a variable in javascript, then the type can be changed and you might be able to do
daysSinceLastOrder = LastOrderDate__c === null ? 'Never' : today() - LastOrderDate__c;
this last one is just a guess, not sure it will work.