Skip to main content
Solved

Have a form pop-up in a new window

  • January 21, 2021
  • 1 reply
  • 698 views

wfilipiak67
Captain II
Forum|alt.badge.img+3

This is for 2020 R2

I am trying to have the base Shipment Confirmation form  (so642000) pop-up in a new window or Tab when printined from the Shipments form SO302000 


Currently, when you select the Reports > Print Shipment Confirmation the Shipment Confirmation opens in the current window. 

I can add a new form & set it to open in a new tab or Pop-Up but need some guidance on the existing form. 

Thank you!

Best answer by Hughes Beausejour

Acumatica uses C# exception mechanism to redirect to another web page (the report launcher is a web page).

 

You can create a customization with a graph extension that intercept the report redirect exception. Then you can modify the WindowMode property to New and rethrow the report redirect exception.

 

Source code for this solution:

using PX.Data;
using System;
using System.Collections;

namespace PX.Objects.SO
{
    public class SOShipmentEntry_Extension : PXGraphExtension<SOShipmentEntry>
    {
        public delegate IEnumerable ReportDelegate(PXAdapter adapter, String reportID);
        [PXOverride]
        public IEnumerable Report(PXAdapter adapter, String reportID, ReportDelegate baseMethod)
        {
            if (reportID == "SO642000")
            {
                IEnumerable returnValue = adapter.Get();

                try
                {
                    returnValue = baseMethod(adapter, reportID);
                }
                catch (PXReportRequiredException ex)
                {
                    ex.Mode = PXBaseRedirectException.WindowMode.New;
                    throw ex;
                }

                return returnValue;
            }
            else
            {
                return baseMethod(adapter, reportID);
            }
        }
    }
}

View original
Did this topic help you find an answer to your question?

1 reply

Hughes Beausejour
Acumatica Employee
Forum|alt.badge.img+2
  • Acumatica Developer Support Team
  • 91 replies
  • Answer
  • February 18, 2021

Acumatica uses C# exception mechanism to redirect to another web page (the report launcher is a web page).

 

You can create a customization with a graph extension that intercept the report redirect exception. Then you can modify the WindowMode property to New and rethrow the report redirect exception.

 

Source code for this solution:

using PX.Data;
using System;
using System.Collections;

namespace PX.Objects.SO
{
    public class SOShipmentEntry_Extension : PXGraphExtension<SOShipmentEntry>
    {
        public delegate IEnumerable ReportDelegate(PXAdapter adapter, String reportID);
        [PXOverride]
        public IEnumerable Report(PXAdapter adapter, String reportID, ReportDelegate baseMethod)
        {
            if (reportID == "SO642000")
            {
                IEnumerable returnValue = adapter.Get();

                try
                {
                    returnValue = baseMethod(adapter, reportID);
                }
                catch (PXReportRequiredException ex)
                {
                    ex.Mode = PXBaseRedirectException.WindowMode.New;
                    throw ex;
                }

                return returnValue;
            }
            else
            {
                return baseMethod(adapter, reportID);
            }
        }
    }
}


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings