This document describes the PX1000 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1000 | An invalid signature of the PXAction handler is used. |
Error | Available |
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.
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.
{
}
}
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();
}
}