Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 2.5 KB

PX1005.md

File metadata and controls

72 lines (55 loc) · 2.5 KB

PX1005

This document describes the PX1005 diagnostic.

Summary

Code Short Description Type Code Fix
PX1005 There is probably a typo in the name of the view delegate or the action delegate. Warning (ISV Level 3: Informational) Available

Diagnostic Description

In a graph, a data view delegate must have the same name as the corresponding data view but with the first letter in a different case (uppercase or lowercase). The same rule applies to action delegates of a graph and their corresponding graph actions.

The code fix changes the name of the delegate in the graph as follows:

  • The name of the data view delegate so that it matches the data view name defined in the graph.
  • The name of the action delegate so that it matches the action name defined in the graph.

The diagnostic supports both graphs and graph extensions.

Example of Code that Results in the Warning

public class LEPMaint : PXGraph<LEPMaint>
{
	public PXSelect<ListEntryPoint> Items;
  
	public IEnumerable itemss() // The PX1005 warning is displayed for this line.
	{
		yield break;
	}

	public PXAction<ListEntryPoint> ViewItem;

	[PXButton]
	[PXUIField]
	public IEnumerable viewItm(PXAdapter adapter)  // The PX1005 warning is displayed for this line.
	{
		yield break;
	}
}

Example of Code Fix

public class LEPMaint : PXGraph<LEPMaint>
{
	public PXSelect<ListEntryPoint> Items;
  
	public IEnumerable items()
	{
		yield break;
	}

	public PXAction<ListEntryPoint> ViewItem;

	[PXButton]
	[PXUIField]
	public IEnumerable viewItem(PXAdapter adapter)
	{
		yield break;
	}
}

Related Articles