Platform API: Changes to the Methods of the ARPaymentEntry Graph
In previous versions of MYOB Acumatica, when a developer wanted to customize the PX.Objects.AR.ARPaymentEntry graph by modifying the behavior of its methods, the developer had to copy a large amount of code from the original graph. This process was necessary even for implementing simple customizations, such as implementing a filter to include only the documents that have a particular status. The following methods belong to the ARPaymentEntry graph, whose behavior was difficult to modify:
- public static int GetCustDocsCount(LoadOptions opts, ARPayment currentARPayment, ARSetup currentARSetup,PXGraph currentGraph)
- public static PXResultset<ARInvoice> GetCustDocs(LoadOptions opts, ARPayment currentARPayment, ARSetup currentARSetup, PXGraph currentGraph)
Since these methods were declared as public static
, it was not possible to
override them. In MYOB Acumatica
2025.1, these methods have been moved to the new
PX.Objects.AR.CustomerDocsExtensionBase abstract graph extension and
their method signatures have been modified as follows:
- public virtual int GetCustDocsCount(LoadOptions opts, ARPayment currentARPayment, ARSetup currentARSetup)
- public virtual PXResultset<ARInvoice> GetCustDocs(LoadOptions opts, ARPayment currentARPayment, ARSetup currentARSetup)
Because the methods above are now declared as public virtual
and have been
moved to an abstract graph extension, a developer can simply override these methods to
modify their behavior. For details about the code changes in this release, see the Reference
List of Changes.
Overriding the GetCustDocsCount and GetCustDocs Methods
To override the GetCustDocsCount and GetCustDocs methods, the developer must declare a second-level graph extension that is derived from the ARPaymentEntryCustomerDocsExtension graph extension, as shown in the following code example.
public class ARPaymentEntryMyExtension:
PXGraphExtension<ARPaymentEntryCustomerDocsExtension, ARPaymentEntry>
{
public override int GetCustDocsCount(LoadOptions opts, ARPayment currentARPayment,
ARSetup currentARSetup)
{
...
}
public override PXResultset<ARInvoice> GetCustDocs(LoadOptions opts,
ARPayment currentARPayment, ARSetup currentARSetup)
{
...
}
}