Step 3: Defining the Data View of the Form
In this step, you will add the data view to the RSSVPaymentPlanInq
graph, which works with the Open Payment Summary (RS401000) form. (You added this
graph in Step 1: Creating the Form.) In
this data view that provides data for the grid (table) of the inquiry form, you
should select only those repair work orders that are not yet paid and the invoices
for these orders.
To define the data view of the form in the RSSVPaymentPlanInq
graph,
do the following:
- In the
RSSVPaymentPlanInq.cs
graph, add the following member. (Replace the automatically generatedDetailsView
member if you have used the Customization Project Editor to create the graph.)[PXFilterable] public SelectFrom<RSSVWorkOrderToPay>. InnerJoin<ARInvoice>.On<ARInvoice.refNbr. IsEqual<RSSVWorkOrderToPay.invoiceNbr>>. Where<RSSVWorkOrderToPay.status. IsNotEqual<RSSVWorkOrderWorkflow.States.paid>>. View.ReadOnly DetailsView;
The
InnerJoin
clause adds information from the invoice that was created for the repair work order so that you can display the due date and balance of the invoice on the page.The
Where
clause excludes all orders with the Paid status from the results of the query.Because users do not need to edit any records on the inquiry form, you use the
ReadOnly
view type, which defines the selection of records in read-only mode. In the UI, MYOB Acumatica Framework automatically disables the editing of data records that were retrieved through a read-only data view. - If you have generated the
RSSVPaymentPlanInq
graph from the Code Editor, remove theMasterView
view and theMasterTable
andDetailsTable
classes. - Build the project.