Redirection to Webpages: To Add Redirection Links to the Grid by Using the PXSelector Attribute
The following activity will walk you through the process of adding redirection links to the grid of a form by using the PXSelector attribute.
Story
Suppose that you want to improve the navigation between the rows of the grid on the Open Payment Summary (RS401000) form and the invoices listed in these rows. You plan to do this by adding redirection links to give users the ability to navigate to the entry form with the detailed information about the sales invoice.
You need to replace the text numbers in the Invoice Nbr. column with links that a user can click to open the data entry form, Invoices (SO303000), for the sales invoice whose number the user has clicked. The user can then view the settings and make any needed modifications. You will add these links by configuring the ASPX file of the form.
Process Overview
- Adding redirection links by using the PXSelector
attribute inside a
RowTemplate
element in the ASPX file of the form - On the Open Payment Summary (RS401000) form, testing the redirection links to make sure they redirect the user to the Invoices (SO303000) form with the record selected
System Preparation
Make sure that you have completed the steps described in the following prerequisite activities:
- Test Instance for Customization: To Deploy an Instance for Developing Inquiry Forms
- Inquiry Forms: To Set Up an Inquiry Form
- Filtering Parameters: To Add a Filter for an Inquiry Form
- Data View Delegates: To Add a Filtering Query Dynamically
- Data Aggregation: To Retrieve Aggregated Data
- Use of PXProjection: To Display Multiple DAC Data on a Tab
Step 1: Adding a Link by Using the PXSelector Attribute
- Make sure that the DAC that holds invoice records has the PXPrimaryGraph attribute or its descendants declared on it. The DAC that holds invoice records can be either ARInvoice or SOInvoice (the DAC that extends from ARInvoice).
- In the
RSSVWorkOrder
DAC, add the PXSelector attribute to theInvoiceNbr
field as shown in the following code.[PXSelector(typeof(SearchFor<SOInvoice.refNbr>. Where<SOInvoice.docType.IsEqual<ARDocType.invoice>>))]
The
RSSVWorkOrderToPay
DAC, which is used on the Open Payment Summary form, inherits theInvoiceNbr
field, including its attributes. Adding the PXSelector attribute to theRSSVWorkOrder
DAC can later allow to configure the same link for other forms where this DAC is used such as the Repair Work Orders (RS301000) form.Note: You can also add the PXSelector attribute to the extension of theRSSVWorkOrder
DAC by using the PXMerge attribute. For details, see Customization of Field Attributes in DAC Extensions - Add the necessary using directives.
- Build the project.
- In the RS401000.aspx file, add the
CommitChanges="True"
property to thePXGridColumn
object for theInvoiceNbr
column. - In the PXGridLevel container, add the
RowTemplate
element and add the PXSelector element inside it, as shown in the following code.<RowTemplate> <px:PXSelector ID="edInvoiceNbr" runat="server" DataField="InvoiceNbr" AllowEdit="True" /> </RowTemplate>
- Publish the customization project.
Step 2: Testing the Redirection Links
To test the redirection links that you have implemented, do the following:
- In MYOB Acumatica, open the Open Payment Summary (RS401000) form.
The form should look similar to the one shown in the following screenshot. Notice that links are shown in the Invoice Nbr. column.
- In any row with a repair work
order (that is, any row with Order Type set to
WO), click the invoice number.The Invoices (SO303000) form should open in a new window with the invoice displayed.Tip: Depending on type of the invoice, the Invoices and Memos (AR301000) form may be opened instead of the Invoices form. The logic that determines which form to open is embedded in MYOB Acumatica.