Going the verbose yourGraph.Caches(typeofe method seems to just work better.
Django,
I uncommented the Update call and still got the same result.
I’ll try your other suggestion and see if that changes anything.
It almost seems like there is some disconnect where it does not know where to write to in the database.
I tried enabled the Request Profiler and the SQL Profiler, and I do not see any attempted insert statements.
Thanks
Scott
Scott, can you share the full code of your graph extension?
Not sure this is your problem, but you only need to define PXParent on a single DAC field. You have it defined for every key field.
You have ReceiptType defined as a key field, but in your screenshots, ReceiptType is null.
zfebert56,
Sure, Here’s the full code for the graph extension.
There is some unrelated stuff in there, that has been in place and functioning for a good while.
My ultimate goal is to have a dialog for data entry which is what the AddPOLineNonConf action is. I’m using TestAction2 just for temporary testing.
I just made the changes suggested by Django, and I get the same results when testing. Nothing is persisted to the DB table and no errors are raised.
Thanks to all for your assistance on this.
Scott
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using PX.Common; using PX.Data; using PX.Objects.GL; using PX.Objects.CM; using PX.Objects.CS; using PX.Objects.CR; using PX.Objects.TX; using PX.Objects.IN; using PX.Objects.EP; using PX.Objects.AP; using PX.Objects.AR; using PX.Objects.SO; using SOOrder = PX.Objects.SO.SOOrder; using SOLine = PX.Objects.SO.SOLine; using PX.Data.DependencyInjection; using PX.Data.ReferentialIntegrity.Attributes; using PX.LicensePolicy; using PX.Objects.PM; using CRLocation = PX.Objects.CR.Standalone.Location; using PX.Objects.AP.MigrationMode; using PX.Objects.Common; using PX.Objects.Common.Discount; using PX.Data.BQL.Fluent; using PX.Data.BQL; using PX.Objects.Common.Bql; using PX.Objects.Extensions.CostAccrual; using PX.Objects.DR; using PX.Objects.IN.Services; using PX.Objects; using PX.Objects.PO;
namespace PX.Objects.PO { public class POOrderEntry_Ext : PXGraphExtension<POOrderEntry> { public static bool IsActive() => true;
Good call out on the receipttype that was an error I missed from a copy/paste.
I thought that may be the issue, but still not persisting after correcting that. I’ll test with the PXParent, I thought you had have it defind for each keyfield.
Thanks
Scott
I removed the multiple PXParent attributes and I found an additional field that incorrectly has IsKey = True and removed it. Still not able to get any records for my custom table to persist.
Here’s the revised DAC
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
I guess having 2 views declared for the same DAC confused the framework.
I’ve created a new “Filter” dac for that view.
Scott
Another question regarding my custom field on the PO Line extension used to store the PXLineNbr.
This works on new records, but I get a null reference error on existing records. If I manually update the field for a PO line to zero vs. null the error goes away.
Is there a recommended way to handle this this issue?
I know I could do a custom sql script to update all polines from null to 0, but I was not sure if there is way to handle it without the script.
I did not see a way to specify a default value when adding the custom field to the database scripts section.
// PXLineNbr #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
// POLin Extension #region UsrNonConfLineNbrCntr
PXDBInt()] PXUIField(DisplayName = "NonConfLineNbrCntr")] PXDefault(0, PersistingCheck = PXPersistingCheck.Nothing)] public virtual int? UsrNonConfLineNbrCntr { get; set; } public abstract class usrNonConfLineNbrCntr : PX.Data.BQL.BqlInt.Field<usrNonConfLineNbrCntr> { }
#endregion
I don’t know what is the best way to solve it. You can use SQL, and you can also try to default the value to zero in FieldDefaulting or RowSelecting events.
I think I’ll plan on the SQL script for now.
Thanks for the feedback, and the help resolving my original issue.