0
votes

I'm trying to override the UpdateCommandByGenerationMethod method in PIGenerator graph.

enter image description here

Acumatica gives a blank template as follows :

public delegate BqlCommandWithParameters UpdateCommandByGenerationMethodDelegate(BqlCommandWithParameters cmd);
[PXOverride]
public BqlCommandWithParameters UpdateCommandByGenerationMethod(BqlCommandWithParameters cmd, UpdateCommandByGenerationMethodDelegate baseMethod)
{
  /* */
  return baseMethod(cmd);
}

This will publish fine w/out error. But when I load the screen. I get an error :

Method PX.Objects.IN.PhysicalInventory.BqlCommandWithParameters UpdateCommandByGenerationMethodTSiteIdField,TInventoryIdField,TSubItemIdField,TLocationIdField is a generic method definition

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Method PX.Objects.IN.PhysicalInventory.BqlCommandWithParameters UpdateCommandByGenerationMethodTSiteIdField,TInventoryIdField,TSubItemIdField,TLocationIdField is a generic method definition

The actual method signature in Acumatica is as follow :

protected virtual BqlCommandWithParameters UpdateCommandByGenerationMethod<TSiteIdField, TInventoryIdField, TSubItemIdField, TLocationIdField>(
BqlCommandWithParameters cmd)
    where TSiteIdField : IBqlOperand
    where TInventoryIdField : IBqlField
    where TSubItemIdField : IBqlField
    where TLocationIdField : IBqlField
{
    ...
}

So how do I fix the declaration of the delegate method ?

Thanks in advance.

1
From last attempt and a talk with someone from Acumatica i don't believe it is still possible to PXOverride a method with with Generics. Would be interested if anyone has found a solution however.Brendan

1 Answers

1
votes

Unfortunately it is not possible to PXOverride a method if it uses generics