Skip to main content
Question

pop-up dialog box moderUI 25R2 not working

  • February 5, 2026
  • 3 replies
  • 52 views

Forum|alt.badge.img

Details: This popup works in the classic version, but it no longer works after migrating. Specification: When the "good service type" field is selected, a popup appears with three options: "Detraction," "Auto-Detraction," or "Not Applicable." If I select "Detraction," the "Detraction" field is checked; if I select "Auto-Detraction," it's checked; if I select "Not Applicable," nothing happens, the checkmarks are removed. The popup works up to this point, but the problem is that when I select one of the options, it disappears.

Here I share images

 

Here my code: event, ts and html:

Code event:
  protected virtual void APInvoice_TBienServ_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            APInvoice api = e.Row as APInvoice;
            if (api == null) return;

            var apiExt = api.GetExtension<XTAPInvoice>();

            TaxRev trRow = PXSelectJoin<TaxRev,
                InnerJoin<xtb08Sunat,
                    On<xtb08Sunat.taxCD, Equal<TaxRev.taxID>>>,
            Where<xtb08Sunat.tGdsSvcsCD, Equal<Required<xtb08Sunat.tGdsSvcsCD>>>>.Select(Base, apiExt.TBienServ);
            if (api != null && apiExt != null)
            {
                if (api.DocType == APDocType.Invoice || api.DocType == APDocType.CreditAdj)
                {
                    if (Base.IsCopyPasteContext == true)
                    {
                        apiExt.TBienServ = "000";
                    }

                    if (trRow == null || trRow.TaxRate == null || trRow.TaxRate == 0)
                    {
                        apiExt.Detraccion = false;
                        apiExt.AutoDetraccion = false;

                        if (api.DocType == APDocType.Invoice && apiExt.TDocSunat != "RG")//***
                        {
                            apiExt.TDocSunat = null;
                        }

                    }
                    else
                    {

                        if (Base.Document.AskExt() == WebDialogResult.Yes)
                        {
                            apiExt.Detraccion = true;
                            apiExt.AutoDetraccion = false;
                            PXUIFieldAttribute.SetVisible<XTAPInvoice.detraccion>(cache, api, true);
                            PXUIFieldAttribute.SetVisible<XTAPInvoice.autodetraccion>(cache, api, false);
                        }
                        else if (Base.Document.AskExt() == WebDialogResult.No)
                        {
                            apiExt.AutoDetraccion = true;
                            apiExt.Detraccion = false;
                            PXUIFieldAttribute.SetVisible<XTAPInvoice.autodetraccion>(cache, api, true);
                            PXUIFieldAttribute.SetVisible<XTAPInvoice.detraccion>(cache, api, false);
                        }
                        else if (Base.Document.AskExt() == WebDialogResult.OK)
                        {
                            apiExt.Detraccion = false;
                            apiExt.AutoDetraccion = false;
                        }

                    }
                }
            }

}

 

ts:
export interface APInvoice_TestCST_generated extends APInvoice {}
export class APInvoice_TestCST_generated {
 @autoRefresh TBienServ: PXFieldState<PXFieldOptions.CommitChanges>;
  AutoDetraccion: PXFieldState;
  Detraccion: PXFieldState;
}
html: 
<qp-panel id="Document" caption="Seleccione la opción que aplica al Documento" auto-repaint="true" wg-container="Document">
    <footer style="text-align:center;">
      <qp-button id="btnYes" dialog-result="Yes" caption="Detracción"></qp-button>
      <qp-button id="btnNo" dialog-result="No" caption="Auto-Detracción"></qp-button>
      <qp-button id="btnOk" dialog-result="OK" caption="No Aplica"></qp-button>
    </footer>
  </qp-panel>

 

Here's the classic image that actually works.

 

3 replies

abhimanyuprajapati52
Freshman I
Forum|alt.badge.img

@SaulGomez61,

In Modern UI, dialogs should not be triggered inside FieldUpdated. A better approach is to set a flag in FieldUpdated and then call AskExt() from RowSelected, or move the dialog to a PXAction and open it explicitly from there.

The popup is disappearing because the framework completes the commit cycle and refreshes the screen, not because the dialog itself is failing.


Jhon Reeve Penuela
Freshman I
Forum|alt.badge.img

Hi ​@SaulGomez61 can you check this link How to app a pop up dialog box in customization screen | Community. I hope this help!. 


Forum|alt.badge.img
  • Jr Varsity I
  • February 5, 2026

Hi ​@SaulGomez61,
 

In Modern UI, you can handle UI events using TypeScript with @handleEvent (for example, ValueChanged, RowSelected, etc.).

Also, here is the official documentation about working with dialog boxes in Modern UI:

https://help.acumatica.com/Wiki/(W(1))/Show.aspx?pageid=a037f34a-6b9f-41ae-8d5e-cbad6bc55fb3