Hi Team,
We would like to implement the following feature.
When entering a customer into the Case screen => If that customer has had previous Cases, the system automatically adds rows of the previous Cases in “RELATED CASES” TAB and are arranged in CreatedDateTime of Cases.
I created Event RowInserted but haven't achieved results yet.
Please advise how to do this.
Note: Acumatica Version 2020R1
Best Regatrds,
NNT
//////////////////////////////////////////////////////
namespace PX.Objects.CR
{
public class CRCaseMaint_Extension : PXGraphExtension<CRCaseMaint>
{
#region Event Handlers
protected void CRCaseReference_RowInserted(PXCache cache, PXRowInsertedEventArgs e, PXRowInserted InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (CRCaseReference)e.Row;
if (row == null)
{
return;
}
CRCase rRCa = Base.Case.Current;
CRCase cRCase = PXSelect<CRCase,
Where<CRCase.customerID, Equal<Required<CRCase.customerID>>>>.Select(Base, rRCa.CustomerID);
if (cRCase == null) { return; }
cache.SetValueExt<CRCaseReference.childCaseCD>(row, cRCase.CaseCD);
cache.Update(row);
}
#endregion
}
}
//////////////////////////////////////////////////////