Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 1.77 KB

PX1000.md

File metadata and controls

78 lines (60 loc) · 1.77 KB

PX1000

This document describes the PX1000 diagnostic.

Summary

Code Short Description Type Code Fix
PX1000 An invalid signature of the PXAction handler is used. Error Available

Diagnostic Description

A valid signature of a PXAction handler must satisfy the following requirements:

  • It has one of the forms of declaration shown below.

    protected virtual void actionName()
    {
        ...    
    }
    
    protected virtual IEnumerable actionName(PXAdapter adapter)
    {
        ...
        return adapter.Get();
    }
  • It has the same name as the PXAction field but with the first letter in a different case (uppercase or lowercase).

The code fix changes the PXAction handler signature as shown in the following code.

protected virtual IEnumerable actionName(PXAdapter adapter)
{
   ...
   return adapter.Get();
}

The diagnostic works on graphs and graph extensions.

Example of Incorrect Code

public class SomeEntry : PXGraph<SomeEntry, Primary>
{
    public PXAction<Primary> Release;
    public PXAction<Primary> Report;
   
    public void release(PXAdapter adapter) // The PX1000 error is displayed for this line.
    {
    }
      
    public IEnumerable report() // Another PX1000 error is displayed for this line.
    {
    }
}

Example of Code Fix

public class SomeEntry : PXGraph<SomeEntry, Primary>
{
    public PXAction<Primary> Release;
    public PXAction<Primary> Report;
   
    public IEnumerable release(PXAdapter adapter)
    {
        return adapter.Get();
    }
      
    public IEnumerable report(PXAdapter adapter)
    {
        return adapter.Get();
    }
}