Skip to main content

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

Hi ​@rajeshvemunoori31,
    Instead of override method try with RowInserted or RowInserting Event . Hope it will easy for you.


HI ​@noorula77 

Thank you for your response. 

I need to implement similar logic for AR, AP, and SO transaction screens. Using the CRActivity row event, I need to verify the current record against the CreatedByScreenID or table name to identify from which screen or table the activity is being created. only this way, I can retrieve the custom field value and pass it to the activity.

Do you think it’s not possible to override the methods I mentioned earlier? If overriding is indeed not an option, I will proceed with the RowInserted event approach. However, I just wanted to confirm whether the first approach is feasible or if there’s any other recommended way to achieve this functionality.


Hi ​@rajeshvemunoori31 in 

PXGraphExtension<SOOrderEntry_ActivityDetailsExt, SOOrderEntry>

you can override InitializeActivity
 

         PXOverride]
public virtual void InitializeActivity(CRActivity row, Action<CRActivity> baseMethod)
{
baseMethod(row);
}

Here you will be able to update activity in similar way it works now with BAccountID and ContactID.

But this method does not handle Email activity. I’m still working on it


Reply