Fatal Error after EPC Install
Posted: Wed Aug 16, 2017 1:19 am
Another issue after the EPC update.
I am getting a fatal error in my default command when it tries to execute. First of all the line numbers make no sense. Here you are telling me the error occurred in CMGCCPSummaryCommand line 26. The only "unique" thing I am doing here is that I do have an inheritance chain defined.
Basically its like this:
CMCCCPSummaryCommand extends CMGCommand extends VLFCommand
Each component has its own responsibility, for example VLFCommand listens for design changes and invoke the appropriate methods that are implemented down the chain as well as providing some convince methods for ALL commands in the system.
The error "Reported By" shows VLFCMDHLR which is the VLFCommand. Its line 26 shows the avFrameworkManager.
For some reason now, the avFrameworkManager is no longer being set even though it was before the EPC update.
Here is my VLFCommand for reference.
Edit
I should mention that CMGCCPSummaryCommand is invoked from a custom instance list using the #DataItem.avExecuteDefaultCommand which is new I believe. See https://vlforum.lansa.com.au/viewtopic.php?f=3&t=1483.
Edit
My Filters work the same way. CMGCCPOfficeNumberFilter extends CMGFilter etc.They don't have this problem. They have access to the avFrameworkManager. This makes me think this may be an issue with the new #DataItem.avExecuteDefaultCommand.
I am getting a fatal error in my default command when it tries to execute. First of all the line numbers make no sense. Here you are telling me the error occurred in CMGCCPSummaryCommand line 26. The only "unique" thing I am doing here is that I do have an inheritance chain defined.
Basically its like this:
CMCCCPSummaryCommand extends CMGCommand extends VLFCommand
Each component has its own responsibility, for example VLFCommand listens for design changes and invoke the appropriate methods that are implemented down the chain as well as providing some convince methods for ALL commands in the system.
The error "Reported By" shows VLFCMDHLR which is the VLFCommand. Its line 26 shows the avFrameworkManager.
For some reason now, the avFrameworkManager is no longer being set even though it was before the EPC update.
Here is my VLFCommand for reference.
Code: Select all
function options(*DIRECT)
begin_com role(*EXTENDS #VF_AC010O) height(270) width(500) designmanager(#Design1)
define_com class(#PRIM_VS.Style) name(#Subtle) italic(True) fontsize(10) fontunits(Pixel) foregroundbrush(#Brush1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(Silver)
define_com class(#PRIM_VS.Style) name(#Error) backgroundbrush(#Brush2) borderbottom(1) borderbrush(#Brush3) borderleft(1) borderright(1) bordertop(1) foregroundbrush(#Brush4)
define_com class(#PRIM_VS.SolidBrush) name(#Brush4) color(255:8:2)
define_com class(#PRIM_VS.SolidBrush) name(#Brush3) color(255:6:0)
define_com class(#PRIM_VS.SolidBrush) name(#Brush2) color(255:215:215)
define_com class(#PRIM_DESN) name(#Design1)
define_com class(#PRIM_DESN.Design) name(#Thin) designmanager(#Design1) width(500)
define_com class(#PRIM_DESN.Design) name(#Narrow) designmanager(#Design1) width(800)
define_com class(#PRIM_DESN.Design) name(#Wide) designmanager(#Design1) width(1100)
evtroutine handling(#COM_OWNER.DesignChanged) design(#design)
if (#design *Is *NULL)
* default to Wide
#avFrameworkManager.avRecordTraceAValue component(#COM_OWNER) event("Design Changed but is NULL")
#COM_SELF.DesignChangedToWide
return
endif
#avFrameworkManager.avRecordTraceAValue component(#COM_OWNER) event("Design Changed") avalue(#design.Name)
case of_field(#design.Name.UpperCase)
when (= THIN)
#COM_SELF.DesignChangedToThin
when (= NARROW)
#COM_SELF.DesignChangedToNarrow
when (= WIDE)
#COM_SELF.DesignChangedToWide
otherwise
#COM_SELF.DesignChangedToWide
endcase
endroutine
mthroutine name(DesignChangedToNarrow) access(*PROTECT)
* do nothing, should be redefined in child
endroutine
mthroutine name(DesignChangedToThin) access(*PROTECT)
* do nothing, should be redefined in child
endroutine
mthroutine name(DesignChangedToWide) access(*PROTECT)
* do nothing, should be redefined in child
endroutine
mthroutine name(HighlightProblems) desc('Highlight problems in all panel fields') help('Highlight a problem by adding NAME:MESSGAGE to the message queue. Panel fields will be search by NAME and error style and hint added if found')
define_map for(*INPUT) class(#PRIM_KCOL<#PRIM_EVP #STD_STRNG>) name(#fields) pass(*BY_REFERENCE)
define field(#control) type(*STRING)
define field(#errorMessage) type(*STRING)
define field(#separatorIndex) type(*INT)
#avFrameworkManager.avRecordTrace component(#COM_OWNER) event("Highlighting Problems")
#avFrameworkManager.avRecordTrace component(#COM_OWNER) event(("&1 Messages In Queue").Substitute( #SYS_MSGQ.Messages.ItemCount.AsString ))
for each(#message) in(#SYS_MSGQ.Messages)
if (#message.Text.Contains( ":" ))
#separatorIndex := #message.Text.LastPositionOf( ":" )
#control := #message.Text.Substring( 1 (#separatorIndex - 1) )
#errorMessage := #message.Text.Substring( (#separatorIndex + 1) #message.Text.CurChars )
if (#fields<#control> *IsNot *NULL)
#fields<#control>.Styles.Add( #Error )
#fields<#control>.Hint := #errorMessage
endif
else
* even though we don't have a seperator, we should still display the message
#avFrameworkManager.avIssueMessage text(#message.Text) requester(#COM_OWNER) tomainform(False) clearexistingmessages(False) type(W)
endif
endfor
endroutine
mthroutine name(HightlightProblem) desc('Highlight a single problem control') help('')
define_map for(*INPUT) class(#PRIM_EVP) name(#field) pass(*BY_REFERENCE)
define_map for(*INPUT) class(#STD_STRNG) name(#message)
#field.Styles.Add( #Error )
#field.Hint := #message
#avFrameworkManager.avIssueMessage requester(#COM_OWNER) text(#message) type(W)
endroutine
mthroutine name(ClearProblemHighlights) desc('Clear problem highlights in panel fields') help('Clear all problem highlights in panel fields by removing the hint and error style')
define_map for(*INPUT) class(#PRIM_KCOL<#PRIM_EVP #STD_STRNG>) name(#fields) pass(*BY_REFERENCE)
#avFrameworkManager.avRecordTrace component(#COM_OWNER) event("Clearing Problem Hightlights")
for each(#field) in(#fields)
#field.Styles.Remove( #Error )
#field.Hint := *BLANKS
endfor
#avFrameworkManager.avClearMessages requester(#COM_OWNER)
* this may be redundant
#SYS_MSGQ.ClearAll
endroutine
mthroutine name(ClearProblemHightlight)
define_map for(*INPUT) class(#PRIM_EVP) name(#field) pass(*BY_REFERENCE)
#field.Styles.Remove( #Error )
#field.Hint := *BLANKS
endroutine
end_com
I should mention that CMGCCPSummaryCommand is invoked from a custom instance list using the #DataItem.avExecuteDefaultCommand which is new I believe. See https://vlforum.lansa.com.au/viewtopic.php?f=3&t=1483.
Edit
My Filters work the same way. CMGCCPOfficeNumberFilter extends CMGFilter etc.They don't have this problem. They have access to the avFrameworkManager. This makes me think this may be an issue with the new #DataItem.avExecuteDefaultCommand.