I want to copy everything from one DAC to another DAC. I already followed the one from this thread Thread by Joseph Caruana and this thread Thread by Stan A. And I come up with this code and put it under RowPersisting event.
protected void RoutingOperation_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
  var row = (RoutingOperation)e.Row;
  if (row != null)
    {
      RoutingOperation line = this.RoutingDetails.Select();
      var rev = (RoutingOperation)this.RoutingDetails.Cache.CreateCopy(line);
      this.RoutingDetailRevs.Cache.Insert(rev);
    }     
}
RoutingOperation is the source DAC, and RoutingOperationRev is the new DAC. RoutingDetails is the data view of RoutingOperation DAC and RoutingDetailRevs is the data view of RoutingOperationRev. But nothing happens.
I tried the one from Thread by Joseph Caruana, and I come up with this code
protected void RoutingOperation_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{      
  var row = (RoutingOperation)e.Row;
  if (row != null)
    {           
      RoutingOperationRev rev = PXCache<RoutingOperationRev>.CreateCopy(this.RoutingDetails.Current);
      this.RoutingDetailRevs.Insert(rev);
    }        
}
I got this error,
An object reference is required for the non-static field, method, or property 'PX.Data.PXCache.CreateCopy(object)'
I am wondering, what did I miss. Thank you in advance