UI Only Field DateTime Calculation

edited March 14, 2019 in Questions
So I've seen that UI only fields cannot do calculations on DateTime fields, just Dates using formulas like this post https://community.skuid.com/skuid/topics/calculate-age-with-ui-only-field

Has anyone figured a relatively easy method/hack to do this aside from creating formula fields in Salesforce? We want to subtract 1 hour from a Salesforce DateTime field in the Skuid UI.

Comments

  • Matt SonesMatt Sones 💎💎💎
    edited August 1, 2017
    ui formula fields can use datetime fields. They are just expressed in milliseconds.

    So to subtract an hour, you want
    {{Datetime__c}} - (1000*60*60)
  • edited August 1, 2017
    I had thought so too but tried that many times in past and doesn't display. The calculation seemed to work off Date fields to subtract a day but not DateTime. Just tried it now and still get blank. The DateTime field is in the model.
  • edited August 1, 2017
    This thread from a bit back seems to confirm. Actually even the dates may not work I might have been mistaken.

    https://community.skuid.com/skuid/topics/ui-only-formula-fields-add-1-month-to-date
  • Matt SonesMatt Sones 💎💎💎
    edited August 1, 2017
    What do you get if you change the displaytype of the formula field to Text?
  • edited August 1, 2017
    Zip. Output blank so far for Text, Date, DateTime.

    But after I saw JDs respons that said this isn't supported I stopped playing with it esp since seems like would be straightforward if it did work. If I remove the calculation it does display as a DateTime.
  • Matt SonesMatt Sones 💎💎💎
    edited August 1, 2017
    That's so strange. Well, you can do it with a javascript snippet.
  • edited August 1, 2017
    Yeah, not super versed in those so try to avoid if can but don't we now have to put those as static resources also? I'm only passively following the changes in Salesforce but thought that was one of the big things at least coming, even if I get away with it for today.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!