Skip to main content
Solved

How to Override CreatePaymentExt -> GetRequiredPrepaymentEnabled


Forum|alt.badge.img+1

I’m trying to override the GetRequiredPrepaymentEnabled method on the CreatePaymentExt graph extension.

I’ve multiple methods, but have not been able to get it to work so far. 

Heres a screenshot showing ,my latest attempt. 

 

Best answer by aaghaei

@scottstanaland12  try this in you graph extension

[PXProtectedAccess()]
protected abstract bool GetRequiredPrepaymentEnabled(SOOrder order);

public delegate bool GetRequiredPrepaymentEnabledDelegate(SOOrder order);

[PXOverride]
public virtual bool GetRequiredPrepaymentEnabled(SOOrder order, GetRequiredPrepaymentEnabledDelegate baseMethod)
{
	// Do some stuff
	bool bm = baseMethod?.Invoke(order); // Do not call the base method if you do not need it
	// Do more stuff and return the result
}

 

View original
Did this topic help you find an answer to your question?

4 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1206 replies
  • Answer
  • June 15, 2024

@scottstanaland12  try this in you graph extension

[PXProtectedAccess()]
protected abstract bool GetRequiredPrepaymentEnabled(SOOrder order);

public delegate bool GetRequiredPrepaymentEnabledDelegate(SOOrder order);

[PXOverride]
public virtual bool GetRequiredPrepaymentEnabled(SOOrder order, GetRequiredPrepaymentEnabledDelegate baseMethod)
{
	// Do some stuff
	bool bm = baseMethod?.Invoke(order); // Do not call the base method if you do not need it
	// Do more stuff and return the result
}

 


Forum|alt.badge.img+1

aaghaei, that worked.

Thanks for your help.

 

aaghaei wrote:

@scottstanaland12  try this in you graph extension

[PXProtectedAccess()]
protected abstract bool GetRequiredPrepaymentEnabled(SOOrder order);

public delegate bool GetRequiredPrepaymentEnabledDelegate(SOOrder order);

[PXOverride]
public virtual bool GetRequiredPrepaymentEnabled(SOOrder order, GetRequiredPrepaymentEnabledDelegate baseMethod)
{
	// Do some stuff
	bool bm = baseMethod?.Invoke(order); // Do not call the base method if you do not need it
	// Do more stuff and return the result
}

 

 


Forum|alt.badge.img+1

@aaghaei The next thing I’m running into is I need to override the SatisfyPrepaymentRequirements and ViolatePrepaymentRequirements methods, which are Exteinsion methods on the SOOrder DAC class. 

I’ve tried adding the extension methods to my SOOrder DAC extension, but I have not been able to get it to call my customized methods.  Any ideas?

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1206 replies
  • June 17, 2024

@scottstanaland12 Sorry, I am out of town without my computer. I suggest create a new topic so others can assist and also I suggest instead of screenshots attach your code so people don’t have to redo the work you have already done.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings