I’ve completed the T210 course and want to apply the learning to a real-world application by using a custom table to extend Customer with a tab item and multiple fields, rather than using the customization project to add “user” fields which will extend the Business Account table, not the Customer table, and thus add those fields to all related entities. I know that PXDBDefault and PXParent are needed to link the custom DAC/table to the Customer table. However, when I add the PXParent attribute to my DAC definition for the key field, it throws the “An unhandled exception has occurred for the function ‘MoveNext’.” when updating the DLL file and when attempting to publish, so the project won’t publish. If I comment out the PXParent attribute, the project will publish without issues but of course, saving/updating doesn’t work. How do I figure out what is wrong? The Trace file does not give me an indication of the issue other than it seems like a DAC issue. I thought it might be due to the system fields not being in the same order in the DAC and the table, but that wasn’t it. Thanks.
Beginning of DAC Definition:
public class ZZCustomerDealerExt : PXBqlTable, IBqlTable
{
#region BAccountID
[PXDBInt(IsKey = true)]
[PXDBDefault(typeof(Customer.bAccountID))]
[PXParent(typeof(SelectFrom<Customer>.Where<Customer.bAccountID.
IsEqual<ZZCustomerDealerExt.bAccountID.FromCurrent>>))]
public virtual int? BAccountID { get; set; }
public abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }
#endregion
...
}
Exception Trace:
System.NullReferenceException
Object reference not set to an instance of an object.
at PX.Data.PXFirstChanceExceptionLogger.ProfilerFirstChanceException(Object o, FirstChanceExceptionEventArgs args)
at PX.Data.PXDatabaseProviderBase.SelectOriginalValues(Type table, PXDataFieldParam[] realParameters, Boolean selectAllNeeded)
at PX.Data.PXDatabaseProviderBase.Update(Type table, PXDataFieldParam[] pars)
at PX.Data.UserRecords.UserRecordsDBUpdater.UpdateVisitedRecordsCachedContentForAllUsers(Nullable`1 transactionID, ModifiedDacEntryForUserRecordsUpdate dacEntry, String entityType)
at PX.Data.UserRecords.UserRecordsDBUpdater.UpdateUserRecordsForChangedDACs(Nullable`1 transactionID, IEnumerable`1 updatedDacEntries)
at PX.Data.UserRecords.UserRecordsDBUpdater.UpdateUserRecords(IReadOnlyCollection`1 modifiedDacEntries)
at PX.Data.PXTransactionScope.Complete(PXGraph graph)
at PX.Data.PXGraph.TransactionalPersist()
at PX.Data.PXGraph.RetryTransaction(Action persistBody, Int32 maxRetries)
at PX.Data.PXGraph.Persist()
at Customization.CstDbStorage.SaveDocument(CstDocument document, Boolean resetHash)
at PX.SM.ProjectScriptMaintenance.ProcessItem(CustObjectTypes objectType)
at PX.Data.PXAction`1.<>c__DisplayClass4_0.<.ctor>b__0(PXAdapter adapter)
at PX.Data.PXAction`1.RunHandler(PXAdapter adapter)
at PX.Data.PXAction`1.<Press>d__39.MoveNext()
at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows)
at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
at PX.Web.UI.PXDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
at PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments, PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback)
at PX.Web.UI.PXGrid.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at PX.Web.UI.PXGrid.PX.Web.UI.IPXDataBoundControl.EnsureDataBoundInternal()
at PX.Web.UI.PXCallbackManager.CollectDataControls(Dictionary`2 controlsDic, List`1 controlsList)
at PX.Web.UI.PXCallbackManager.RenderClientData(PXCallbackResultMethod resultMethod, XmlWriter writer)
at PX.Web.UI.PXCallbackManager.GetCallbackResultInternal(PXCallbackResultMethod resultMethod)
at PX.Web.UI.PXCallbackManager.GetCallbackResult(PXCallbackResultMethod resultMethod)
at System.Web.UI.Page.RenderCallback()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at PX.Web.UI.PXPage.ProcessRequest(HttpContext context)
at ASP.pages_au_au209000_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)