Hiding or Disabling Function Buttons
AnsweredIs it possible to hide or disable Function Buttons based on the results of an SQL query?
I have attempted to achieve this via a Validation which executes a Macro which uses the "DISABLE" command but it does not disable the button. Disable or hiding would be a solution to my use case.
-
Official comment
Hi Michael,
It is possible to disable to hide function buttons using Hide() (hiding the item from the screen) and Disable() (setting the item in grey) commands. The SQL part needs to be inserted into the SQL Condition section in your validation. If this is not working for you then please check your SQL by replacing the macro Universal Function results to a message type Universal Function and see where the problem is.
Thanks, Naama
-
Hi Naama:
Thanks for your quick response. I've tried to add to the SQL condition, but am still having a problem. Within the "Button Configuration" window the function button in question has a "Function" of "Universal Function" and the button's "Item Uid"="BOY_99_1". The functionality I've attached to this button works as expected.
I added the DISABLE command to the "SQL Condition" of my Validation Configuration. The Validation Configuration Configuration is on "Data Load" Event of the Item Master (form 150). My SQL condition is as follows:
IF (LEN(ISNULL($[$186.0.0],'')))!=0 DISABLE(BOY_99_1)
I believe I've tried every syntax version against "BOY_99_1" in the above (e.g. $[$BOY_99_1.0.0], $[BOY_99_1.0.0], etc.)
Thanks, Mike
-
Hi Mike,
A tip to check a validation is to replace the result (the macro UF with the disable command) with a message UF.
The you know if your condition is correct.
If the message is displayed at the right moment then your condition and trigger are both correct and the problem is with the macro. If not, then you need to correct the confition. To check if your trigger is correct, you can set the condition to “No Condition” and set the message function in the result of that “No Condition”.Please remember to set a validation to show that button when it needs to be shown. You can look at the following example:
http://service.boyum-it.com/uploads/media/05_-_Create_a_Stop-sign_on_a_Sales_order.pdfThanks, Naama
-
Hi, I want to hide/disable some functions buttons depending on a value of a field. Cant get it to work. This post was the only information I found about it. Is it possible to do? I have the same problem as Mike with:
"I believe I've tried every syntax version against "BOY_99_1" in the above (e.g. $[$BOY_99_1.0.0], $[BOY_99_1.0.0], etc.)"
I get the Trigger to work when I am making a coditiontest with a message
The link Naama refer to above doesnt work
"http://service.boyum-it.com/uploads/media/05_-Create_a_Stop-sign_ona_Sales_order.pdf"
David
-
Hello David,
Here is the example, I just validated the link:
If you get the trigget to work, then the problem is in your Macro, be careful with the Dynamic Syntax you're using. Here is a guide to know more about this: https://support.boyum-it.com/hc/en-us/articles/204284188-Guide-Understanding-Dynamic-Syntax
-
Hi am having the same problem trying to disable the Function button i created on the delivery form. it seemd it doesnot see the function button. i can disable other form element but not the button created by B1up
here is the macro code:
IF($[$81.0.0]!=3)
BEGIN
Disable($[$BOY_99_1.0.0]);
END
ELSE
BEGIN
Enable($[$BOY_99_1.0.0]);
END
Please sign in to leave a comment.
Comments
6 comments