Page 1 of 1

VLF-ONE Execute Default Command when Adding To List

Posted: Sat Oct 21, 2017 3:51 am
by jyoung
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

#avListManager.CurrentInstance.avExecuteDefaultCommand
Should the executedefaultcmd on the AddToList method do the same thing as avExecuteDefaultCommand on the instance?

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

Posted: Sat Oct 21, 2017 9:31 am
by MarkD
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.