Getting a framework business object name

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
trossiter
Posts: 19
Joined: Wed Feb 22, 2017 3:19 am

Getting a framework business object name

Post by trossiter » Wed Oct 25, 2017 12:24 am

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.
There are 10 types of people in the world. Those who read binary, and those who don't.

trossiter
Posts: 19
Joined: Wed Feb 22, 2017 3:19 am

Re: Getting a framework business object name

Post by trossiter » Wed Oct 25, 2017 12:47 am

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.
There are 10 types of people in the world. Those who read binary, and those who don't.

jyoung
Posts: 656
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Getting a framework business object name

Post by jyoung » Wed Oct 25, 2017 12:53 am

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

TomC
Posts: 10
Joined: Thu Mar 10, 2016 10:01 am

Re: Getting a framework business object name

Post by TomC » Wed Oct 25, 2017 2:02 am

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

Post Reply