Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.86 KB

PX1026.md

File metadata and controls

51 lines (38 loc) · 1.86 KB

PX1026

This document describes the PX1026 diagnostic.

Summary

Code Short Description Type Code Fix
PX1026 Underscores cannot be used in the names of DACs and DAC fields. Error Available

Diagnostic Description

Underscores cannot be used in the names of DACs and DAC fields (that is, public and internal DAC properties and corresponding nested classes) because the underscore character is a special symbol for ASPX. If an underscore is used in the name of a DAC or a DAC field, a reference to the DAC property field in ASPX is interpreted incorrectly.

The code fix removes underscores from the selected name of the DAC, DAC property, or DAC nested class.

The diagnostic ignores the DAC nested classes for which the DAC does not contain a DAC property with the same name as the nested class but with the first letter in uppercase.

Example of Incorrect Code

public class SO_Invoice : PXBqlTable, IBqlTable // The PX1026 error is displayed for this line.
{
	#region InvoiceType
	public abstract class invoiceType : IBqlField { }

	[PXDBString(IsKey = true, InputMask = "")]
	[PXDefault]
	[PXUIField(DisplayName = "Invoice Type")] 
	public string Invoice_Type { get; set; } // Another PX1026 error is displayed for this line.
	#endregion
}

Example of Code Fix

public class SOInvoice : PXBqlTable, IBqlTable
{
	#region InvoiceType
	public abstract class invoiceType : IBqlField { }

	[PXDBString(IsKey = true, InputMask = "")]
	[PXDefault]
	[PXUIField(DisplayName = "Invoice Type")] 
	public string InvoiceType { get; set; }
	#endregion
}

Related Articles

Table and Column Naming Conventions