Page 1 of 1

VLF-ONE Custom Instance List Execute Default Command Error After EPC Install

Posted: Tue Aug 15, 2017 3:24 am
by jyoung
In VLF-ONE I have a custom instance list where I replaced the default instance list with my own.

It extends from #VF_AC012O.

I had been using "ExecuteDefaultCommand" to trigger the default command for the object as such. The popup is a custom right click menu to allow copying data to the clipboard.

Code: Select all

evtroutine handling(#InstanceList.ItemGotFocus)

define_com class(#vf_lm003O) name(#DataItem) reference(*DYNAMIC)

#DataItem <= #InstanceList.CurrentItem.RelatedReference *As #VF_LM003O

* Make this the current item
#DataItem.avIsCurrent := True

* Show the default command handler
#DataItem.avBusinessObjectReference.ExecuteDefaultCommand atreferencelevel(1) usebusypanel(#avListManager.RootVF_FR003Owner.CurrentVF_UM010O.BusyPanel) withinstancereferencekey(#DataItem.GetCompositeKeyString) ignoreenablement(False)

#Popup.Caption := #DataItem.avVisualID2
#Popup.ClipboardCopyText := #DataItem.avVisualID1 + " " + #DataItem.avVisualID2
endroutine
After I installed the latest EPCS (31 and 50), I get an error stating "ExecuteDefaultCommand is not a member of component type VF_FR003O". Sure enough, this is one of those internal methods that got renamed to "zInt....".

So my question is how do I trigger the default command from a custom instance list?

Re: VLF-ONE Custom Instance List Execute Default Command Error After EPC Install

Posted: Tue Aug 15, 2017 9:41 am
by MarkDale
There's a new and better way. The DataItem now has an avExecuteDefaultCommand method, which is much simpler to use.

See shipped example DF_T41I1O.


Evtroutine Handling(#xEmployeeList.ItemGotFocus)

Define_Com Class(#vf_lm003O) Name(#DataItem) Reference(*DYNAMIC)

#DataItem <= #xEmployeeList.CurrentItem.RelatedReference *As #VF_LM003O

* Make this the current item

#DataItem.avIsCurrent := True

* Show the default command handler
#DataItem.avExecuteDefaultCommand


Endroutine