Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.78 KB

PX1004.md

File metadata and controls

33 lines (23 loc) · 1.78 KB

PX1004

This document describes the PX1004 diagnostic.

Summary

Code Short Description Type Code Fix
PX1004 The order of view declarations will cause the creation of two cache instances. Message Unavailable

Diagnostic Description

For inherited DAC types, the order of the data view declarations affects the number of PXCache instances for these DACs as follows:

  • Two PXCache instances are created if you declare the data views so that the first data view uses the base DAC, and the second data view uses the derived type.
  • A shared PXCache instance for the base DAC and the derived DAC is created if you declare the data views so that the first data view uses the derived DAC, and the second data view uses the base DAC.

The diagnostic supports graphs and graph extensions. The diagnostic works with the code based on Acumatica Framework 2018 R1 or earlier.

In most cases, you do not need to do anything with this message. If you want to use a shared PXCache instance for the base DAC and the derived DAC, you can change the order of the data view declarations. However, if you use a shared PXCache instance, make sure the PXCache instance refers to the needed DAC type.

Example of Code that Results in the Warning

public class BAccount : IBqlTable { }
public class Customer : BAccount { }

public class CustomerMaint : PXGraph<CustomerMaint, Customer> // The PX1004 warning is displayed for this line.
{
    public PXSelect<BAccount> CustomerBAcc; 
    public PXSelect<Customer> Customer;
 
    // Two cache instances (PXCache<BAccount> and PXCache<Customer>) are created.
}