Skip to main content
Solved

Unable to override an Action on PO screen as it has an optional parameter

  • November 26, 2025
  • 2 replies
  • 93 views
  • Translate All

Joe Schmucker
Captain II
Forum|alt.badge.img+3

I have the same question as this topic which never received an answer:

 

I need to override the EmailPurchaseOrder action to do a simple update to a custom field.

		public delegate IEnumerable emailPurchaseOrder(PXAdapter adapter, [PXString] string notificationCD = null);
[PXButton(CommitChanges = true), PXUIField(DisplayName = "Email PO")]
[PXOverride]
public virtual IEnumerable EmailPurchaseOrder(
PXAdapter adapter,
[PXString]
string notificationCD = null, emailPurchaseOrder BaseMethod)
{
//Logic Here

I get an error that the optional parameter must be the last item in the method.

Any solutions for this?

Best answer by aleksandrsechin

Hi ​@Joe Schmucker 
Try this approach. The only thing I changed is that the parameter BaseMethod is now optional.

public delegate IEnumerable emailPurchaseOrder(PXAdapter adapter, [PXString] string notificationCD = null);
[PXButton(CommitChanges = true), PXUIField(DisplayName = "Email PO")]
[PXOverride]
public virtual IEnumerable EmailPurchaseOrder(PXAdapter adapter,
[PXString]
string notificationCD = null,
emailPurchaseOrder BaseMethod = null)
{
//Logic Here
}


 

View original

2 replies

Forum|alt.badge.img+4

Hi ​@Joe Schmucker 
Try this approach. The only thing I changed is that the parameter BaseMethod is now optional.

public delegate IEnumerable emailPurchaseOrder(PXAdapter adapter, [PXString] string notificationCD = null);
[PXButton(CommitChanges = true), PXUIField(DisplayName = "Email PO")]
[PXOverride]
public virtual IEnumerable EmailPurchaseOrder(PXAdapter adapter,
[PXString]
string notificationCD = null,
emailPurchaseOrder BaseMethod = null)
{
//Logic Here
}


 

Translate

Joe Schmucker
Captain II
Forum|alt.badge.img+3

Hi ​@aleksandrsechin  Thank you!!  That worked like a charm!!

Translate