By using this website, you agree to our Terms of Use (click here)
I have a client that has Manufacturing installed. On the Stock Item Screen the MFG code adds a Manufacturing tab. I want to add a new field to the Manufacturing tab, but I do not want to update the MFG customization package as it will cause issues when a new MFG build comes out. How can I extend the screen extensions of another customization package?
Others have suggested copying the MFG code to another Customization Project and modifying that, but that would mean that I am constantly having to maintain third party code every time they have a new build.
Please note I am using MFG as the example as I have run into this issue a few times with various third party software.
You can extend an extension like this:
public class ZXXXMyExtension: PXGraphExtension<FirstGraphExtension, BaseGraph>
These can be chained like this:
public class ZXXXMySecondExtension: PXGraphExtension<ZXXXMyExtension, FirstGraphExtension, BaseGraph>
public class ZXXXMyThirdExtension: PXGraphExtension<ZXXXMySecondExtension, ZXXXMyExtension, FirstGraphExtension, BaseGraph>
To see this in action with a real sample (2019 R1+), this is how you can override SOOrderEntryExternalTax
//DEFINITION: public class SOOrderEntryExternalTax : ExternalTax<SOOrderEntry, SOOrder>
// ExternalTax is inherited from ExternalTaxBase<TGraph> : PXGraphExtension<TGraph>.
// We should treat it like SOOrderEntryExternalTax : PXGraphExtension<SOOrderEntry>
public class ZXXXSOTaxTweak_SOOrderEntryExternalTaxExt : PXGraphExtension<SOOrderEntryExternalTax, SOOrderEntry>
{
public delegate GetTaxRequest BuildGetTaxRequestDelegate(SOOrder order);
[PXOverride]
public virtual GetTaxRequest BuildGetTaxRequest(SOOrder order, BuildGetTaxRequestDelegate baseMethod)
{
//Call original to get request.
GetTaxRequest request = baseMethod.Invoke(order);
//Your code here, alter request.
//request.___ = ___
//Return request.
return request;
}
}

