I have a Tab form. The main form and first tab sho details from DAC1. Tab 2 contains a grid for records from DAC2.
I have the following views in my graph
public SelectFrom<DAC1>.View DAC1;
public SelectFrom<DAC1>.Where<DAC1.dac1ID.IsEqual<DAC1.dac1ID.FromCurrent>>.View DAC1Detail;
public SelectFrom<DAC2>.Where<DAC2.dac1ID.IsEqual<DAC1.dac1ID.FromCurrent>>.View DAC2;
The foreign key referecens in DAC2 is defined as
#region Dax1ID
[PXDBInt()]
[PXUIField(DisplayName = "DAX1 ID")]
[PXDefault(typeof(DAX1.dax1ID))]
[PXParent(typeof(SelectFrom<DAX1>.Where<DAX1.dax1ID.IsEqual<DAX2.dax1ID.FromCurrent>>))]
public virtual int? Dax1ID { get; set; }
public abstract class dax1ID : PX.Data.BQL.BqlInt.Field<dax1ID> { }
#endregion
If I add a new DAC1 and then save it and then edit the DAC2 grid all works well.
If I add a new DAC1 edit it, then add details to the DAC2 grid and then save it, the DAC2 records are assigned to the wrong dac1ID. If I look in the database I can see the Dac1ID field contains -2147483647
Clearly I’ve missed something. I’ve been through the T210 training document a couple of times, but the scenarios do not quite match what I’m doing.
Any help would be greatly appreciated.