Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 2.03 KB

PX1018.md

File metadata and controls

44 lines (35 loc) · 2.03 KB

PX1018

This document describes the PX1018 diagnostic.

Summary

Code Short Description Type Code Fix
PX1018 The graph with the specified primary view type parameter doesn't contain the primary view of the specified type. Error Unavailable

Diagnostic Description

You can specify a DAC as the second type parameter of a graph to implicitly add definitions of standard actions (such as Cancel and Save) to the graph. The DAC that is specified as the second type parameter must be the same as the primary DAC of the primary data view.

The diagnostic does not check abstract graphs and generic graphs that have generic type parameter as their primary DAC. Such graphs are used as base classes for derived graphs and are not used directly by Acumatica screens. The primary view can be declared in a derived graph. Here is an example of the generic graph with a generic type parameter as a primary DAC:

public class ServiceContractEntryBase<TGraph, TPrimary> : PXGraph<TGraph, TPrimary>
where TGraph : PX.Data.PXGraph
where TPrimary : class, PX.Data.IBqlTable, new()
{
   //...
}

To fix the issue, you can use one of the following options:

  • In the second type parameter of the graph, specify the primary DAC of the primary data view.
  • Change the primary DAC of the primary data view so that it matches the second type parameter of the graph.
  • Remove the second type parameter of the graph along with implicit definitions of standard actions.

Example of Incorrect Code

public class POOrderEntry : PXGraph<POOrderEntry, POOrder> // The PX1018 error is displayed for this line.
{
    public PXSelect<SOOrder> Orders;
}

Example of Possible Code Fix

public class POOrderEntry : PXGraph<POOrderEntry, POOrder>
{
    public PXSelect<POOrder> Orders;
}