VLF-ONE Execute Default Command when Adding To List

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
Posts: 351
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Execute Default Command when Adding To List

Post by jyoung » Sat Oct 21, 2017 3:51 am

I am trying to execute the default command when adding an item to the list. (there is only one item)

Code: Select all

define field(#select) type(*BOOLEAN) default(False)

#select := True

#listManager.AddtoList visualid1(#visualId1) visualid2(#visualId2) nkey1(#item.OfficeNumber) nkey2(#item.ControlNumber) nkey4(#countryCode) nkey3(#item.JDENumber) akey1(#item.Department) acolumn1(#item.OfficeName) acolumn2(#item.OfficeStateCode) dcolumn1(#STD_DATEX.AsDisplayString( ISO )) relatedreference(#item) select(#select) setascurrent(#select) executedefaultcmd(#select)
The default command however does not get executed. The item is selected and current.
After the item is added I can get the current instance and execute the default command like

Code: Select all

Should the executedefaultcmd on the AddToList method do the same thing as avExecuteDefaultCommand on the instance?

Posts: 318
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Execute Default Command when Adding To List

Post by MarkD » Sat Oct 21, 2017 9:31 am

Yes it should.

This is fixed in the next version - http://docs.lansa.com/14/en/lansa048/in ... 8_8025.htm

BTW- The other way to execute the default command is to get the AddToList to return a reference to item it created back to you, then use #NewItem.ExecuteDefaulCommand.

Post Reply