This document describes the PX1091 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1091 | This invocation of the base action handler can cause a StackOverflowException . |
Warning (ISV Level 1: Significant) | Unavailable |
If an action delegate that is overridden in PXGraphExtension
invokes the base action delegate, you must either override the action delegate by using the PXOverride
attribute or redeclare the PXAction
field member inside PXGraphExtension
. If you do not follow this rule, the customization can cause a StackOverflowException
.
public class AccountByPeriodEnq_Extension : PXGraphExtension<AccountByPeriodEnq>
{
[PXUIField(DisplayName = "View Document",
MapEnableRights = PXCacheRights.Select,
MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable viewDocument(PXAdapter adapter)
{
GLTranR current = Base.GLTranEnq.Current;
if (current != null)
return Base.ViewDocument.Press(adapter); // The PX1091 warning is displayed for this line.
return adapter.Get();
}
}
public class AccountByPeriodEnq_Extension : PXGraphExtension<AccountByPeriodEnq>
{
public delegate IEnumerable viewDocumentDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable viewDocument(PXAdapter adapter, viewDocumentDelegate baseMethod)
{
return baseMethod(adapter);
}
}
public class AccountByPeriodEnq_Extension : PXGraphExtension<AccountByPeriodEnq>
{
public PXAction<AccountByPeriodFilter> ViewDocument;
[PXUIField(DisplayName = "View Document",
MapEnableRights = PXCacheRights.Select,
MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable viewDocument(PXAdapter adapter)
{
GLTranR current = Base.GLTranEnq.Current;
if (current != null)
return Base.ViewDocument.Press(adapter);
return adapter.Get();
}
}