Skip to main content
Solved

Create custom Popup Dialog Box on Projects (PM301000) not working

  • March 10, 2026
  • 2 replies
  • 27 views

I’m trying to convert a popup dialog box that worked in Classic UI to Modern UI.

I’m so close, but I’m missing something. When the dialog pops up the ok button is constantly disabling. I think it has something to do with the way I’m making the view, but I can’t quite figure it out. Additional details in the view section below.

I feel like I must be close, but can’t seem to make it happen. Calling on the experts!

The Class for the dialog:

    [Serializable]

    [PXHidden]

    public class TCAPCreateSalesOrderFilter : PXBqlTable, IBqlTable

    {

        public static bool IsActive()

        {

            return true; 

        }

        #region OrderType

        public abstract class orderType : PX.Data.BQL.BqlString.Field<orderType> { }

        [PXDBString(2, IsFixed = true, InputMask = ">aa")]

        [PXDefault(typeof(Search2<SOOrderType.orderType,

            InnerJoin<SOSetup, On<SOOrderType.orderType, Equal<SOSetup.defaultOrderType>>>,

            Where<SOOrderType.active, Equal<boolTrue>>>))]

        [PXSelector(typeof(Search<SOOrderType.orderType>),

        DescriptionField = typeof(SOOrderType.descr))]

        [PXUIField(DisplayName = "Order Type")]

        public  String OrderType { get; set; }

        #endregion

    }

Create the view for the Dialog

This is the view. I added the second part to try and match Yuriy Zaletskyy’s blog post on the subject. This seems to be a significant part, but I don’t know what I’m doing wrong. When I have it, I get a popup with “Object reference not set to an instance of an object” but it all works. I get the dialog, it returns the result. All good. When I don’t have it there, no error, but my “Okay” is always disabled.

        public PXFilter<TCAPCreateSalesOrderFilter> TCAPSOTypeDialog;

        public IEnumerable tCAPSOTypeDialog(PXAdapter adapter)

        {

            return adapter.Get();

        }

Typescript:

export interface PM301000_AcuProPopup extends PM301000{}

export class PM301000_AcuProPopup

{

    CheckCopyParams: PXActionState;

   @viewInfo({ containerName: "Copy To" })

    TCAPSOTypeDialog = createSingle(TCAPCreateSalesOrderFilter);

}

export class TCAPCreateSalesOrderFilter extends PXView {

    OrderType: PXFieldState<PXFieldOptions.CommitChanges>;

}

HTML:

<template>

    <qp-panel id="TCAPSOTypeDialog" caption="Caption" auto-repaint="true">

        <qp-template id="FormView" name="1-1-1" class="equal-height">

            <qp-fieldset id="FormFilterSlotA" view.bind="TCAPSOTypeDialog" slot="A" caption="Pick SO Type">              

                <field name="OrderType"></field>

            </qp-fieldset>

        <footer>

            <qp-button id="btnPanelOK" caption="OK" state.bind="Save" dialog-result="OK"></qp-button>

            <qp-button id="btnPanelCancel" caption="Cancel" dialog-result="Cancel"></qp-button></footer>

        </qp-template>

    </qp-panel>

</template>

Best answer by travisk91

So...the answer, as expected, isn’t compllicated…

state.bind="Save" in the HTML was limited the button to showing when the source record was dirty...which of course makes no sense.

IDK how I was getting it to work with the “public IEnumerable tCAPSOTypeDialog(PXAdapter adapter)” but that is not needed.

2 replies

  • Author
  • Freshman II
  • Answer
  • March 10, 2026

So...the answer, as expected, isn’t compllicated…

state.bind="Save" in the HTML was limited the button to showing when the source record was dirty...which of course makes no sense.

IDK how I was getting it to work with the “public IEnumerable tCAPSOTypeDialog(PXAdapter adapter)” but that is not needed.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • March 10, 2026

Thank you for sharing your solution with the community ​@travisk91!