Hello Everyone,
I have a custom field on the sales order header where users can enter a value. This same custom field is also available on all activity screens (Task, Email, Chat, Note, etc.). If a user creates an activity from the sales order, I need to pass the value of this custom field from the sales order to the activity screen.
Additionally, this logic should also work for the shipment and invoice screens.
In Acumatica, the activity screens are handled by the ActivityDetailsExt
generic graph, which contains several virtual methods used for creating activities. I tried overriding these methods in the SOOrderEntry
extension, but while there are no errors, the overridden methods are not being executed.
Can anyone suggest how to pass the custom value from transaction screens (sales order, shipment, invoice) to the corresponding activity screens?
Acumatica base code for activity logic is in below class.
public class SOOrderEntry_ActivityDetailsExt : ActivityDetailsExt<SOOrderEntry, SOOrder, SOOrder.noteID>
{
}
My custom extension:
//Tried direct inheritance but not working.
//public class MySOOrderEntry_ActivityDetailsExtExt : SOOrderEntry_ActivityDetailsExt
//Extension also not working.
public class CustomSOOrderEntry_ActivityDetailsExtExt : PXGraphExtension<SOOrderEntry_ActivityDetailsExt, SOOrderEntry>
{
public static bool IsActive() => true;
//public delegate void CreateTimeActivityDelegate(PXGraph targetGraph, int classID, string activityType);
// PXOverride()]
//public virtual void CreateTimeActivity(PXGraph targetGraph, int classID, string activityType, CreateTimeActivityDelegate basemethod)
//{
//}
PXOverride]
// public override void CreateTimeActivity(PXGraph targetGraph, int classID, string activityType) //, Action<PXGraph, int, string> baseMethod
public virtual void CreateTimeActivity(PXGraph targetGraph, int classID, string activityType, Action<PXGraph, int, string> baseMethod)
{
baseMethod?.Invoke(targetGraph, classID, activityType);
//My custom logic
}
}
Thanks