I’m attempting to add a new custom table / dac into the PO Entry screen.
The new DAC is tied to POLine and it can be a one to many relationship.
I have PXParent and PXLineNbr attributes defined in the custom DAC and have the appropriate dac fields marked as IsKey = True.
I have a vew declared, and when I insert into the view the key fields are defaulted from the selected PO Line as they should be.
When I debug, I can see the records in the cache in the Inserted collection.
When I call the Base.Save.Press(), nothing is persisted to my custom table.
No errors are generated, and the inserted record still shows in the cache inserted collection.
I’m hoping I’m missing something simple, any ideas?
View declaration
public PXSelect<AHSPOLineNonConf, Where<AHSPOLineNonConf.orderType, Equal<Current<POLine.orderType>>,
And<AHSPOLineNonConf.orderNbr, Equal<Current<POLine.orderNbr>>,
And<AHSPOLineNonConf.lineNbr, Equal<Current<POLine.lineNbr>>>>>> AHSPOLineNonConfView;
Partial DAC declaration
using System;
using PX.Data;
using PX.Data.BQL.Fluent;
using PX.Data.ReferentialIntegrity.Attributes;
namespace PX.Objects.PO
{
[Serializable]
[PXCacheName("AHSPOLineNonConf")]
[PXPrimaryGraph(typeof(POOrderEntry))]
public class AHSPOLineNonConf : IBqlTable
{
#region OrderType
[PXDBString(2, IsKey = true, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Order Type")]
[PXDBDefault(typeof(POLine.orderType))]
[PXParent(typeof(SelectFrom<POLine>.
Where<POLine.orderType.IsEqual<AHSPOLineNonConf.orderType.FromCurrent>.
And<POLine.orderNbr.IsEqual<AHSPOLineNonConf.orderNbr.FromCurrent>.
And<POLine.lineNbr.IsEqual<AHSPOLineNonConf.lineNbr.FromCurrent>>>>))]
public virtual string OrderType { get; set; }
public abstract class orderType : PX.Data.BQL.BqlString.Field<orderType> { }
#endregion
#region OrderNbr
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Order Nbr")]
[PXDBDefault(typeof(POLine.orderNbr))]
[PXParent(typeof(SelectFrom<POLine>.
Where<POLine.orderType.IsEqual<AHSPOLineNonConf.orderType.FromCurrent>.
And<POLine.orderNbr.IsEqual<AHSPOLineNonConf.orderNbr.FromCurrent>.
And<POLine.lineNbr.IsEqual<AHSPOLineNonConf.lineNbr.FromCurrent>>>>))]
public virtual string OrderNbr { get; set; }
public abstract class orderNbr : PX.Data.BQL.BqlString.Field<orderNbr> { }
#endregion
#region LineNbr
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Line Nbr")]
[PXDBDefault(typeof(POLine.lineNbr))]
[PXParent(typeof(SelectFrom<POLine>.
Where<POLine.orderType.IsEqual<AHSPOLineNonConf.orderType.FromCurrent>.
And<POLine.orderNbr.IsEqual<AHSPOLineNonConf.orderNbr.FromCurrent>.
And<POLine.lineNbr.IsEqual<AHSPOLineNonConf.lineNbr.FromCurrent>>>>))]
public virtual int? LineNbr { get; set; }
public abstract class lineNbr : PX.Data.BQL.BqlInt.Field<lineNbr> { }
#endregion
#region NonConfLineNbr
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Non Conf Line Nbr")]
[PXLineNbr(typeof(POLineExt.usrNonConfLineNbrCntr))]
public virtual int? NonConfLineNbr { get; set; }
public abstract class nonConfLineNbr : PX.Data.BQL.BqlInt.Field<nonConfLineNbr> { }
#endregion
#region ReceiptType
[PXUIField(DisplayName = "Type")]
[PXDBString(2, IsFixed = true, IsKey = true)]
Table declaration
CREATE TABLE [dbo].[AHSPOLineNonConf](
[CompanyID] [int] NOT NULL,
[OrderType] [char](2) NOT NULL,
[OrderNbr] [nvarchar](15) NOT NULL,
[LineNbr] [int] NOT NULL,
[NonConfLineNbr] [int] NOT NULL,
[Quantity] [int] NULL,
[LotSerialNo] [nvarchar](255) NULL,
[InventoryID] [int] NULL,
[InventoryDescr] [nvarchar](256) NULL,
[NonConfReason] [nvarchar](max) NULL,
[Resolution] [nvarchar](max) NULL,
[ReceiptType] [nchar](2) NULL,
[ReceiptNbr] [nvarchar](30) NULL,
[tstamp] [timestamp] NOT NULL,
[CreatedByID] [uniqueidentifier] NOT NULL,
[CreatedByScreenID] [char](8) NOT NULL,
[CreatedDateTime] [datetime] NOT NULL,
[LastModifiedByID] [uniqueidentifier] NOT NULL,
[LastModifiedByScreenID] [char](8) NOT NULL,
[LastModifiedDateTime] [datetime] NOT NULL,
CONSTRAINT [AHSPOLineNonConf_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[OrderType] ASC,
[OrderNbr] ASC,
[LineNbr] ASC,
[NonConfLineNbr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
Best answer by Zoltan Febert
View original