Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 2.03 KB

PX1037.md

File metadata and controls

51 lines (34 loc) · 2.03 KB

PX1037

This document describes the PX1037 diagnostic.

Summary

Code Short Description Type Code Fix
PX1037 An unbound DAC field cannot be used in a key declaration. Error Unavailable

Diagnostic Description

The diagnostic checks the fields that are used in a primary, foreign, or unique key declaration. The key declaration cannot contain unbound fields. The checking for unbound DAC keys in DAC applies to all DACs except abstract DACs.

To fix the issue, remove unbound fields from the key declaration and replace them with database-bound fields.

The diagnostic does not suggest a code fix.

Example of Incorrect Code

[PXCacheName("Sales Order Line")]
public partial class SOLine : PX.Data.PXBqlTable, PX.Data.IBqlTable
{
	public static class MyFK
	{
		public class SOOrder : PX.Objects.SO.SOOrder.PK.ForeignKeyOf<SOLine>.By<unboundField, orderNbr> { }
	}

	[PXInt]
	public virtual int? UnboundField { get; set; }
	public abstract class unboundField : PX.Data.IBqlField { }

	public abstract class orderNbr : PX.Data.IBqlField { }
}

Related Articles

Primary Key

To Define a Primary Key

PXCacheNameAttribute Class

PXPrimaryGraphAttribute Class

[Data Access Classes] (https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=3f6ee8e9-b29e-4dab-b4f8-4406c3ef101d)

[Bound Field Data Types] (https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=61059393-8873-451f-b474-783906330fc6)

[Unbound Field Data Types] (https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=61059393-8873-451f-b474-783906330fc6)