There is master-child table and master record has composite key on OrderNbr and RevisionNbr, On UI we want to present the Selector for both the fields OrderNbr with Max Revision number for Order number selector Revision Number selector based on order Number selected ON UI.
also on UI we have function to create New revision, How we can create revision by Code, I am getting error of MUlti part query, when I defined IsKey= true for both the fields and tried to Save the data By
Graph.primaryView.Insert()
ForEach(UIRow){
Graph.ChildView.Insert
}
Graph.Persist();
Note the MAster table has Identity column in the SQL server has Key
Update- Parent Table DAC -
#region TestSuiteID
public abstract class testSuiteID:PX.Data.IBqlField {
}
protected int? _TestSuiteID;
[PXDBIdentity()]
public virtual int? TestSuiteID {
get {
return this._TestSuiteID;
}
set {
this._TestSuiteID = value;
}
}
#endregion
#region TestSuiteCD
public abstract class testSuiteCD:PX.Data.IBqlField {
}
protected string _TestSuiteCD;
[PXDBString(50, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXDefault()]
[PXUIField(DisplayName = "Test Group ID")]
[PXSelector(typeof(EWQCTestSuite.testSuiteCD), typeof(EWQCTestSuite.testSuiteCD), typeof(EWQCTestSuite.revisionNo), typeof(EWQCTestSuite.name))]
public virtual string TestSuiteCD {
get {
return this._TestSuiteCD;
}
set {
this._TestSuiteCD = value;
}
}
#endregion
#region RevisionNo
public abstract class revisionNo:PX.Data.IBqlField {
}
protected int? _RevisionNo;
[PXDBInt(IsKey=true)]
[PXDefault(1)]
[PXUIField(DisplayName = "Revision No")]
public virtual int? RevisionNo {
get {
return this._RevisionNo;
}
set {
this._RevisionNo = value;
}
}
#endregion
Child Table Dac -
#region TestSuiteVariableID
public abstract class testSuiteVariableID:PX.Data.IBqlField {
}
protected int? _TestSuiteVariableID;
[PXDBIdentity(IsKey = true)]
public virtual int? TestSuiteVariableID {
get {
return this._TestSuiteVariableID;
}
set {
this._TestSuiteVariableID = value;
}
}
#endregion
#region TestSuiteID
public abstract class testSuiteID:PX.Data.IBqlField {
}
protected int? _TestSuiteID;
[PXDBInt()]
[PXDBDefault(typeof(EWQCTestSuite.testSuiteID))]
[PXParent(typeof(Select<EWQCTestSuite, Where<EWQCTestSuite.testSuiteID, Equal<Current<EWQCTestSuite.testSuiteID>>>>))]
public virtual int? TestSuiteID {
get {
return this._TestSuiteID;
}
set {
this._TestSuiteID = value;
}
}
#endregion
Note - Child table does not have MAster tab CD and revision number column as I added Identity column fr reference and have PXParent with Identity column. Both Dac has other fields that I have not added here.
Other issue that I am facing is When I am Deleting the record I am getting some Primarykey reference error (Delete by default acumatica delete button on Primary DataView)