Page 1 of 1

Disabling Command Definition buttons

Posted: Fri Apr 02, 2021 8:55 am
by ESODevKJ
Hi All,

I need to disable the command definition buttons at the top of an instance list. I used this code:

Code: Select all

#avframeworkmanager.avChangeCommandState Objectname(#UOOBNM) Commandname('COMMAND_NEW') Enabled(false)
Image

which works, but when user clicks on an instance list column, the button becomes enabled.

Image

How do I make sure that this button stays disabled no matter what action the user performs?

Thanks in advance!

Re: Disabling Command Definition buttons

Posted: Fri Apr 09, 2021 2:19 am
by René Houba
Hi,

This seems incorrect bahaviour to me.

So what you say is:
You disable the button with:
#avframeworkmanager.avChangeCommandState Objectname(#UOOBNM) Commandname('COMMAND_NEW') Enabled(false)

Which works.....

But when a user clicks on a column of the instance list, the new button becaomes Enabled(true)

Re: Disabling Command Definition buttons

Posted: Fri Apr 09, 2021 3:51 am
by ESODevKJ
I agree, and maybe I'm missing something, but that's what's occurring.

Re: Disabling Command Definition buttons

Posted: Fri Apr 09, 2021 10:56 am
by MarkD
Could you clarify what you mean by the user clicking on an instance list column?

1. Do you mean the column heading?


2. Or do you mean on an item in the column which also causes the instance list ‘row’ (item) to become selected?

If it is the second option, then the act of selecting the instance list item would automatically enable all object and instance level commands for the business object.

e.g. If your New command is an object level command then this would cause it to become (re)enabled.

In that is what is happening you can probably solve it by executing the avChangeCommandState method again in the command handler that is executed when the user clicks on the item.

Re: Disabling Command Definition buttons

Posted: Mon Apr 12, 2021 6:28 am
by René Houba
Good point Mark ;-)

Re: Disabling Command Definition buttons

Posted: Mon Apr 12, 2021 11:09 pm
by ESODevKJ
Thanks all for the input. I ended up modifying the avcheckauth routine in the IIP to just not have the commands shown if there was no security clearance for user.