Skip to main content
Solved

How to Override CreatePaymentExt -> GetRequiredPrepaymentEnabled

  • 14 June 2024
  • 4 replies
  • 47 views

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. 

 

@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
}

 


aaghaei, that worked.

Thanks for your help.

 

@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
}

 

 


@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?

 


@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