This document describes the PX1004 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1004 | The order of view declarations will cause the creation of two cache instances. | Message | Unavailable |
For inherited DAC types, the order of the data view declarations affects the number of PXCache instances for these DACs as follows:
- Two
PXCacheinstances 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
PXCacheinstance 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.
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.
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.
}