Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 2.47 KB

PX1087.md

File metadata and controls

68 lines (52 loc) · 2.47 KB

PX1087

This document describes the PX1087 diagnostic.

Summary

Code Short Description Type Code Fix
PX1087 This invocation of the base data view delegate can cause a StackOverflowException. Warning (ISV Level 1: Significant) Unavailable

Diagnostic Description

If a data view delegate overridden in PXGraphExtension invokes the base view delegate, you must redeclare the field member of the PXSelectBase type or one of its successors. If this field member is not redeclared, the invocation of the base data view delegate can cause a StackOverflowException.

To prevent the warning from occurring, you should redeclare the field member of the PXSelectBase type or one of its successors in the graph extension.

Example of Code that Results in the Warning

public class AccountByPeriodEnq_Extension : PXGraphExtension<AccountByPeriodEnq>
{
    protected IEnumerable glTranEnq()
    {
        int startRow = PXView.StartRow;
        int totalRows = 0;

        var result = Base.GLTranEnq.View.Select(PXView.Currents, //The PX1087 error is displayed for this line.
            PXView.Parameters, PXView.Searches, PXView.SortColumns,
            PXView.Descendings, PXView.Filters, ref startRow,
            PXView.MaximumRows, ref totalRows);

        PXView.StartRow = 0;
        return result;
    }
}

Example of Possible Code Fix

public class AccountByPeriodEnq_Extension : PXGraphExtension<AccountByPeriodEnq>
{
    [PXFilterable]
    public PXSelectOrderBy<GLTranR,
        OrderBy<Asc<GLTranR.tranDate,
            Asc<GLTranR.refNbr,
            Asc<GLTranR.batchNbr,
            Asc<GLTranR.module,
            Asc<GLTranR.lineNbr>>>>>>> GLTranEnq;

    protected IEnumerable glTranEnq()
    {
        int startRow = PXView.StartRow;
        int totalRows = 0;

        var result = Base.GLTranEnq.View.Select(PXView.Currents,
            PXView.Parameters, PXView.Searches, PXView.SortColumns,
            PXView.Descendings, PXView.Filters, ref startRow,
            PXView.MaximumRows, ref totalRows);

        PXView.StartRow = 0;
        return result;
    }
}

Related Articles