Page 1 of 1

Getting a framework business object name

Posted: Wed Oct 25, 2017 12:24 am
by trossiter
I have two different business objects that both use the same reusable part for their command handler. The command handler has two buttons on it, but I would like to hide the button when the command handler is executed under one business object and show it under the other. I know you can get the command name from the framework in code, but is there a way to do the same for the business object name? I'm not finding it in LANSA documentation.

Thanks.

Re: Getting a framework business object name

Posted: Wed Oct 25, 2017 12:47 am
by trossiter
I think I just answered my own question. I'll just use a different command for the second business object and get the command name.

Re: Getting a framework business object name

Posted: Wed Oct 25, 2017 12:53 am
by jyoung
I think you can use a custom property on your objects to denote a name/value and then get that property with with avGetUserProperty.

http://docs.lansa.com/14/en/lansa048/in ... 8_0670.htm

http://docs.lansa.com/14/en/lansa048/in ... lf2265.htm

http://docs.lansa.com/14/en/lansa048/in ... erProperty

Re: Getting a framework business object name

Posted: Wed Oct 25, 2017 2:02 am
by TomC
From the command handler source, you can use the following:

To return the business object User Object Type name or caption:
#COM_OWNER.avObjectType
#COM_OWNER.avObjectCaption

To return the command handler User Object Type name or caption:
#COM_OWNER.avCommandType
#COM_OWNER.avCommandCaption