Instance List Question

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
User avatar
lawingo
Posts: 78
Joined: Fri Dec 04, 2015 6:41 am

Instance List Question

Post by lawingo »

I have created my own Snap In Instance List. Everything works but the "Business Object Commands" associated to that Business Object do not appear. When I click on an item from the list, the commands tagged as "Instance Commands" show correctly - Like "Details" and "Notes". However, the commands tagged as "business object" commands do not show - like "New" & Delete". Typically they load when the Instance List loads. I can right click on the Instance list and see them that way, but that doesn't make sense to the user. If I take away my "Snap In Instance List Browser ID" and restart VLF then they all show up. I have tried searching the Documentation but I see nothing. Also - I have looked at an example under Programming Techniques > Basic > Snap in Instance Lists and notice the example doesn't include "Business Object Commands." Is it by design not to show the commands?

Any suggestions?

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

Re: Instance List Question

Post by jyoung »

Its been my experience that when creating your own instance list, you have to do a lot of stuff yourself, as noted here. http://docs.lansa.com/14/en/lansa048/in ... 8_6090.htm

We've standardized on our lists so that they are all custom (gives us more flexibility to do what we want) and in the space on top of the list is a "mini" toolbar where we put things like "Downloads", "New" etc or in some cases paging mechanisms.

My suggestion would to be find a spot in your custom list to drop a button or other "actionable" control and trigger the business object command directly.

You can trigger a business object command with avSwitch http://docs.lansa.com/14/en/lansa048/in ... 8_1675.htm.

Here is a couple captures of our instance lists.
simple instance list.PNG
simple instance list.PNG (5.32 KiB) Viewed 9136 times
complex instance list.PNG
complex instance list.PNG (16.79 KiB) Viewed 9136 times
EDIT
Removed comment regarding switching to an instance command.
Last edited by jyoung on Wed Nov 22, 2017 9:58 am, edited 1 time in total.
User avatar
lawingo
Posts: 78
Joined: Fri Dec 04, 2015 6:41 am

Re: Instance List Question

Post by lawingo »

Perfect. Thanks for the tip.

Chad
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Instance List Question

Post by MarkD »

I created this test snap in instance list browser:

Code: Select all

Begin_Com Role(*EXTENDS #vf_ac012O) Style(#Blue)
Define_Com Class(#Prim_vs.Style) Name(#Blue) Normbackcolor(Blue)
End_Com
The business object it is associated with has commands New and Delete at the object level and commands Example1, 2 and 3 at the instance level. When I run it I see the options to execute the commands above my snap in browser like this:
Capture.PNG
Capture.PNG (21.51 KiB) Viewed 9112 times
The object level commands New and Delete are enabled and seem to function correctly.
The instance level commands are not currently enabled because the snap in browser has not selected any instance(s).
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Instance List Question

Post by MarkD »

You should be able to execute an instance level command (handler).
The switch operation should execute against the current instance list item – so you need to set one of them to #ListItem.avIsCurrent := True.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Instance List Question

Post by jyoung »

Now that you mention it I think that was the problem I was having with the instance commands. I don't think I had one selected because I was switching to it from another object, so there was no way to select it. I will update my earlier comment.
Post Reply