Replicate Salesforce Mod Function

  • 1
  • Question
  • Updated 4 months ago
  • Answered
  • (Edited)

I have a need to calculate the date of the previous Friday. Since the mod function is not available for Skuid formula fields, I am currently doing this with a Salesforce formula field: 

(TODAY()) - MOD(TODAY() - DATE(1900,1,12),7)

This will return the date of the previous Friday, so if calculated on 5/10/2018 it will return 5/4/2018. Since Salesforce formula fields are not calculated until the record is saved, when displayed on a new record page in skuid this field will be blank until the row on the model is saved. I am trying for a way to display this on a new record page while the new record is still being edited and before it is saved.

The mod function basically takes a number, divides it by another number, and returns the remainder. Is there any way to replicate this in a Skuid UI-only formula?

Photo of Joe Dobbels

Joe Dobbels

  • 788 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Brian Lee

Brian Lee, Official Rep

  • 620 Points 500 badge 2x thumb
Official Response
Thank you for your patience! Skuid has fixed the issue regarding Modulo operator not being listed as an operator in UI-Only formula fields (issue CORE-1934) in the new 12.1.9 release which is now available on the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading.
Thanks again for alerting us of these issues!