Skip to main content
Solved

How can the system automatically add previous Case history lines of the same customer to the "RELATED CASES" TAB?

  • October 25, 2023
  • 1 reply
  • 65 views

nhatnghetinh
Captain II
Forum|alt.badge.img+11

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
  }
}

 

//////////////////////////////////////////////////////

 

 

Best answer by Django

I think what you’re looking for is to add a view to the graph that pulls the records from CRCase that you want to display in the tab and the view will use .FromCurrent to filter based on the customer ID selected.

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+6
  • Captain II
  • 548 replies
  • Answer
  • October 25, 2023

I think what you’re looking for is to add a view to the graph that pulls the records from CRCase that you want to display in the tab and the view will use .FromCurrent to filter based on the customer ID selected.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings