Disable button depending on value of other field

I have this button (Resolve) to resolve an issue but I need it to disable when the status is “Complete”. I figured I could use a data rule where I just use a boolean value that is just not used elsewhere and then check the condition. But i can’t seem to get that to work or do anything. Any ideas?

Here is the rule I made (I also tried EQUALS):

The setup looks correct.
When you are previewing your app, press F12 to load Dev Tools, switch back to your app and click anywhere in the browser window. ctrl-alt-8 (enable debug mode), then ctrl-alt-v (display data from dataviews in console)

Now, back to dev tools window, expand the UD13 → dataview with the arrow.
Expand the row you have selected next to Array → (0,1,2,3, etc.), and check the value for ShortChar07. is it “Complete”?

1 Like

Yup, it definitely is!
image

I guess I’m going to verify i dont have something else overriding it or something. im so at a loss at this point. It’s such a basic function I feel silly being lost on it.

In F12 Dev Tools Console:
epDebug.setDebugModeStatus(true)
epDebug.rules
There are a few rule related methods in epDebug, the autocomplete should show them as you start typing, try checking this to see how your rules are working out, for example:

BTW, if you don’t intend to store data in UD13.CheckBox20, the best practice here would be to use a new temporary dataview that exists for this purpose (or you can re-use the TransView dataview if that app has it)

I would do this:

Create a new dataview “temp” or anything you want, dont configure any options, just uncheck “dirty” and save it.
Now, in your Window OnLoad event, add a row-add widget, and add temp.resolve to “”:


{
	"resolve": ""
}

now, bind your button to temp.resolve.
set your datarule to affect temp.resolve: action data view: temp, field: resolve
that might get it working.

1 Like

So for this, if I set my EpBinding to say Transview.Resolved, how do I setup the rule then because the transview has no fields?

Rules allow you to manually type the field in (you could also add it to the dataview if you want it to populate in the autocomplete, but not required)



If you re-use the TransView DV, you don’t need the row-add (because TransView already has a row) - you can create the “Resolved” column within the dataview “on the fly”

AH yay! Okay thank you so much! Finally got it to work. really appreciate all the help :slight_smile:

3 Likes