If you want e.g. to flip red/green you can make 2 buttons visible/invisible :oops:
Here's an old doc I'd figure I'd throw in here before I lose it forever on my hard drive. O:)
Issue
How can I dynamically control Command and Menu buttons on Navision forms?
Resolution
Assign a value to the Name property of a command or menu button then you can dynamically set the Enabled or Visible properties of the control in the trigger code using C/AL commands.
For example, to disable a menu button that has the value of the Name property set to btnCustomer, you would use the following command:
CurrForm.btnCustomer.ENABLED(FALSE);
Unfortunately, there is not a method to dynamically control the individual menu items of a menu button. However, it would be possible to create two different menu buttons with different Name property values. These two button controls could then be stacked on top of each other and trigger code added to the form to make one button visible and one button not visible, based upon the desired criteria.
For example, to control which menu button is displayed, based on the existence of a customer email address, where the button controls were named btnCustomer1 and btnCustomer2, you would use the following code in the OnAfterGetCurrRecord trigger:
IF "E-Mail" = '' THEN BEGIN
CurrForm.btnCustomer1.VISIBLE(TRUE);
CurrForm.btnCustomer2.VISIBLE(FALSE);
END ELSE BEGIN
CurrForm.btnCustomer1.VISIBLE(FALSE);
CurrForm.btnCustomer2.VISIBLE(TRUE);
END;
You could try something like the comment button on the sales order form. Here the button is transparent and there is a bitmap control behind the button so the button takes on the appearance of the bitmap.
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You can put the labeltext in the sourceexpression.
You can also add leadersdots to a textbox.
It's a workaround :?
OK, we have workaround for Label.
Any idea for Button, Menu button or Menu button menu items?
If you want e.g. to flip red/green you can make 2 buttons visible/invisible :oops:
Otherwise I cannot think of anything.
Here's an old doc I'd figure I'd throw in here before I lose it forever on my hard drive. O:)
Issue
How can I dynamically control Command and Menu buttons on Navision forms?
Resolution
Assign a value to the Name property of a command or menu button then you can dynamically set the Enabled or Visible properties of the control in the trigger code using C/AL commands.
For example, to disable a menu button that has the value of the Name property set to btnCustomer, you would use the following command:
CurrForm.btnCustomer.ENABLED(FALSE);
Unfortunately, there is not a method to dynamically control the individual menu items of a menu button. However, it would be possible to create two different menu buttons with different Name property values. These two button controls could then be stacked on top of each other and trigger code added to the form to make one button visible and one button not visible, based upon the desired criteria.
For example, to control which menu button is displayed, based on the existence of a customer email address, where the button controls were named btnCustomer1 and btnCustomer2, you would use the following code in the OnAfterGetCurrRecord trigger:
IF "E-Mail" = '' THEN BEGIN
CurrForm.btnCustomer1.VISIBLE(TRUE);
CurrForm.btnCustomer2.VISIBLE(FALSE);
END ELSE BEGIN
CurrForm.btnCustomer1.VISIBLE(FALSE);
CurrForm.btnCustomer2.VISIBLE(TRUE);
END;
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks Harry
I hoped there are some more sophisticated method
I'm looking at Form 42!
I have localized version, does this matter?
Thanks.