Enable button based on condition

  • 1
  • Idea
  • Updated 3 years ago
Not sure if this is possible I didn't see a way to do it.

It would be great to enable a button if a condition is active/deactivated.
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
There may be a simpler way, but you could do it with a ui-only field.

Set up your field to be a formula returning a boolean to access the condition with merge syntax like so:

{{$Model.OpenTasks.conditions.0.inactive}} -- will be false if the Condition is currently active, true if it is inactive

Then, enable the button based on the value of the formula field.
(Edited)
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
Hi Matt,

This was a great suggestion. Thank you! I switched it from 'inactive' to 'value' because I need to look at a few buttons. The UI field works great in that respect. The issue is setting up the button to render. I am working with all aggregrate models. When I set up the rendering for the button I get the below error:

Notes: 'TimePeriodCondition' is my ui only field.
A Skuid Model, 'IntegrationAggr', requested a Field with relationship name 'TimePeriodCondition', on the IntegrationTimeSheet__c Object, but Skuid could not find a valid Field accessible through this relationship name. Please check that this Field actually exists on this Object (or on any related Objects). If it does not exist, remove it from this Model.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Hmm. Might be a bug, but I'll let skuid weigh in on that one.

Try setting up a new basic model just for your ui-only field?
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
That would be a good work around if what i am trying to do is not possible. Although based on the documentation I thought this could work. Hopefully skuid will give me some insight.

Thanks!
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
I posted a solution to this problem here.