0
votes

I have a Generic Inquiry and Endpoint to get all rows and fields of INTran, which works fine.

What fields in an INTran row are it's unique keys?

I am populating a DB on a different server with this data, so I can do some detailed analysis.

I am using the LastModified field to get updates, and I need to setup my local DB keys so the correct row will be updated, and a new row will not be inserted (unless its keys are new).

I do not have login access to the Acumatica server, so I have to do this through the API.

Version 2019R1

1

1 Answers

2
votes

If you have access to the Acumatica website you can look up the INTran DAC (class INTran) with the Source Code page SM204570.

enter image description here

The DAC indicates primary keys are fields:

  1. INTran.DocType
  2. INTran.RefNbr
  3. INTran.LineNbr

You can also deduce the DB type and length in the DAC attribute from the same INTran DAC.

Example DocType, PXDBString with IsFixed of length 1 maps to DB type char(1) :

#region DocType
public abstract class docType : PX.Data.BQL.BqlString.Field<docType> { }
protected String _DocType;
[PXUIField(DisplayName = INRegister.docType.DisplayName)]
[PXDBString(1, IsFixed = true, IsKey = true)]
[PXDefault(typeof(INRegister.docType))]
[INDocType.List()]
public virtual String DocType
{
    get { return this._DocType; }
    set { this._DocType = value; }
}
#endregion

PXDBString without IsFixed maps to varchar type.

PXDBString with IsUnicode maps to nvarchar.

PXDBInt maps to int.

DAC attributes should always match the DB type but DB is the final source of truth.

In DB here's how those fields are declared:

[DocType] [char](1) NOT NULL
[RefNbr] [nvarchar](15) NOT NULL
[LineNbr] [int] NOT NULL