Hello Everyone,
I have a method that I am calling them in different graphs. To make this happen I have used Reflection and dynamic parameters. a part of my method require creating a copy of cache. If I copy and paste my code to each grapf it works just fine but this copy part wen is in the generic class raises the below error:
“Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Member 'PX.Data.PXCache<PX.Objects.EP.EPApproval>.CreateCopy(PX.Objects.EP.EPApproval)' cannot be accessed with an instance reference; qualify it with a type name instead”
I have tried all 4 methods of copy that I new but no luck. Here are the methods I have tried:
//Method 1
EPApproval _approvalNext1 = Base.Approval.Cache.CreateCopy(approvalLast) as EPApproval;
//Method 2
EPApproval _approvalNext2 = Base.Caches[typeof(EPApproval)].CreateCopy(approvalLast) as EPApproval;
//Method 3
EPApproval _approvalNext3 = CallByName(Base.Approval.Cache, "CreateCopy", CallType.Get, approvalLast) as EPApproval;
// Method 4
EPApproval _approvalNext4 = CallByName(Base.Caches[typeof(EPApproval)], "CreateCopy", CallType.Get, approvalLast) as EPApproval;
Any help is greatly appreciated.
Best answer by markusray17
View original