Dynamic Form Rules on Date Fields

  • 38
  • 1
  • Question
  • Updated 6 months ago
  • Answered
I have a form with these three fields.  Date received, Term Length and Term Date.  I would like to set up rules so that the term date is calculated based on what Term Length is select.  So if 30 days is select form Term length then I would like the Term date to be 29 days from the Date Received.  I know this can be done with a formula field but was hoping it could be done on the form rules.  Is this possible?
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb

Posted 6 months ago

  • 38
  • 1
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb
Any ideas?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,660 Points 50k badge 2x thumb
Use a formula and then if the data entry field is blank, use the form rule to populate the data entry field, but by being a data entry field you an override if necessary.
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb
Okay, my only issue with using a formula is that one of the options is other.  So if they select other, I would like them to be able to enter the date.  How can I do that in a formula?  Here is what I currently have.

If([Term Length]= "30", [Date Received]+Days(29),
    [Term Length]= "60", [Date Received]+Days(59),
    [Term Length]= "90", [Date Received]+Days(89),
    [Term Length]="120", [Date Received]+Days(119),
    [Term Length]="Immediate",[Date Received])

The term date field is a read only since it is a formula but I need it to be editable if Term Length is Other.  I'm hoping not to have to use two fields for this.

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,660 Points 50k badge 2x thumb
You will never be able to edit a formula field.  I'm suggesting to have a formula field and have the form rule copy the value from the formula field into the data entry field when the data entry field is blank.  That was it will be automatic, but still editable.
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb
That makes sense but it's not working.  I have the term date formula and it's calculating correctly.  I have the form rule set to when term length is not equal to other, change term date to the value in the term date formula.  Don't know why it wouldn't update.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,660 Points 50k badge 2x thumb
Can you edit that form rule and observe the checkbox at the very very bottom. Uncheck it. That will Force the rule to always fire.
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb
Wait, it is working.  The problem is getting it to fire when the term length is changed from one to another.  So lets say the user selected 30 but meant to select 90.  It doesn't change the date in the term date.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,660 Points 50k badge 2x thumb
See my post above
Photo of cowannbell

cowannbell

  • 1,350 Points 1k badge 2x thumb
Thanks, that did it.