4

I have a formula field with type checkbox on custom object.This field gets calculated based on two Date fields.

Formula logic :

IsCallNeeded =  
 NOT(
   OR(
     Date_1__c > (TODAY() - 15), 
     Date_2__c > (TODAY() - 7)
   )
 )

I have some records in that custom object with both date fields are NULL.When I view the record in detail page,the checkbox is being checked. But when I see the same record in report,it's unchecked.

Detail Page enter image description here

Report Screeen enter image description here

Can any one help me to understand why its showing different results in report and detail page?

4
  • I don't think that is possible. Formulas are evaluated the same way whether on detail or report screen. Can you e.g. add screenshots showing the difference so we can get an idea of other possible causes? Commented Mar 27, 2015 at 10:37
  • @guy I have added screenshots.
    – Maha
    Commented Mar 27, 2015 at 11:02
  • This sounds silly, but are you positive there's only one field with the label "Is Call Needed"? Commented Mar 27, 2015 at 11:11
  • Yes Jeremy. there are only three fields in that object.
    – Maha
    Commented Mar 27, 2015 at 11:14

3 Answers 3

2

as mentioned in the other answer you can follow up with Salesforce support on why the formula gives different results between the report and the detail page.

meanwhile to get consistent behaviour you can use ISBLANK function on the date fields before doing the comparison .. something like this..

IF(
   OR( ISBLANK(Date_1__c), ISBLANK(Date_2__c) ), 
   FALSE,
   NOT( OR( Date_1__c > (TODAY() - 15), Date_2__c > (TODAY() - 7) ) ) 
) 
1
  • I was able to fix the issue by changing my formula as follows. But I am wondering why its not showing same results in detail page and report. I will create a case with Salesforce support. IF( OR( Date_1__c > (TODAY() - 15), Date_2__c > (TODAY() - 7) ), FALSE, TRUE ) Thanks @Vamsi
    – Maha
    Commented Mar 27, 2015 at 13:29
1

I was able to replicate this in my org. So it appears to be a bug in SFDC!

I suppose it has to do with the combination of

  • empty (null) fields and
  • the formula being evaluated individually on the record detail page, but in some kind of batch mode when being run in a report.

You should report this with SFDC support (open a Case). It's easy to replicate so should not be that much work ;-)

1
  • Thanks for your reply. Let me create a case with Salesforce support.
    – Maha
    Commented Mar 27, 2015 at 13:31
0

I can confirm that checking the field values with ISBLANK will solve the problem as suggested by Vamsi above. This works with Text and Currency fields as well as Date fields. I would have commented on Vamsi's answer but don't have enough creds yet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .