Skip to main content

Hello,

I have added a dialog to Bills and Adjustments Screen to be able to route the documents to an assignee. See below snip:

 

I have made the “Assignee” Required. As you can see the DAC is set to force the user to enter the assignee. Here is the DAC:

#region Owner

public abstract class owner : PX.Data.BQL.BqlInt.Field<owner> { }

0Owner(PersistingCheck = PXPersistingCheck.Null, DisplayName = "Assignee", Required = true, ValidateValue = true)]

public virtual Int32? Owner { get; set; }

#endregion

 

  1. What I would like to happen is to keep this dialog open if “Assignee” is null or invalid and user clicks OK but dialog gets closed. I tried to force this by field selecting/verifying but I didn’t have any luck. How can I manage this?
  2. Is the anyway to remove the close button (X) from top of the dialog and disable the ESC key on it?

I removed the “X” using JS.


Hi @aaghaei  Can you please share the solution here for reference.


@Naveen B here is what I have done as refernce.

1) assign a function name to the dialog property ClientEvents-AfterShow="removeCloseButton" in my example as follows

<px:PXSmartPanel runat="server" ID="pnlOpenDialogBox" AutoReload="True" ShowAfterLoad="True" CaptionVisible="True" Caption="Routing Panel" Key="RoutingPanelDialog" AcceptButtonID="cbOk" CancelButtonID="cbCancel" AutoCallBack-Target="formOpenDialogBox" AutoCallBack-Command="Refresh" ClientEvents-AfterShow="removeCloseButton" CloseButtonDialogResult="No">

2) write a simple JS with the same function name assigned above addressing the dialog element in my example as follows

<px:PXJavaScript runat="server" ID="jsRoutingPanelDialog" IsStartupScript="False" Script="function removeCloseButton() {document.getElementById('ctl00_phG_pnlOpenDialogBox_cap').childrenr0].style.display='none';}"

3) publish your customization and “X” is removed as shown below.

 


Thanks, @aaghaei  for sharing with us. This helps us a lot.


Reply