Compare DateTime fields

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I am comparing 2 datetime fields in a UI field and not sure why I am not getting the results expected.

IF( {{UI_Only_Field__r.Delete_Date_Time__c}} > {{Completed_Date_Time__c}} ,"True","False")

These are the results:
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Bill~

I think your syntax is the problem for the UI only formula. Try IF( {{Delete_Date_Time}} > {{Completed_Date_Time}} ,"True","False").

Thanks!
Karen
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Why would I not need the __c part of the field name?
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Bill,

You setup the Model UI fields as part of the Skuid page.  They only exist when you view the page.  Since Salesforce doesn't know they exist, it doesn't enforce any naming convention.  Whatever you enter in the Field Id is what you need to use when you reference the field in merge syntax.

Thanks,

Bill
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Bill~
An easy way to ensure that you are using the correct syntax is to use "Insert Field" and then select the field you want inserted in your UI only formula field, as seen below.

Thanks!
Karen