Loading ...

How to Open a PXDBWeblink Field in a New Window in Acumatica

By default, the PXDBWeblink attribute in Acumatica is designed to open URLs in a new tab. However, if your customization requires opening links in a new window, you can achieve this with a custom button and additional configuration.

This article demonstrates how to implement this functionality step by step, ensuring clarity and ease of execution.

Steps to Open a PXDBWeblink in a New Window

Step 1: Create or Modify the DAC Field

Ensure the DAC field representing the URL is set up as a standard PXDBString. For example:



Step 2: Add a Custom Action in the Graph

In the graph class managing the relevant screen, define a custom action that opens the link in a new window. Here's the example code:


This code adds a button to the screen that reads the URL from the DAC field and opens it in a new browser window using the _blank target attribute.

 

Step 3: Test the Customization

  1. Build and publish the customization project.
  2. Navigate to the screen where the functionality is implemented.
  3. Populate the URL field, save the record, and click the Open Documentation button.
  4. Verify that the URL opens in a new window.

Summary

By implementing a custom button with the PXRedirectToUrlException class, you can control how URLs open in Acumatica screens. This method ensures a seamless user experience while adhering to your specific requirements.

This customization enhances the flexibility of Acumatica's interface and opens up opportunities for improved user workflows.