Solved

Is it possible to change the default button in the warning dialog when changing class for a customer?

  • 28 June 2022
  • 6 replies
  • 132 views

We would like the warning dialog when changing the customer class to default to No rather than Yes.  I have looked at the code and found where it is defined:

protected virtual void Customer_CustomerClassID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
{
Customer row = (Customer)e.Row;
CustomerClass cc = (CustomerClass)PXSelectorAttribute.Select<Customer.customerClassID>(cache, row, e.NewValue);
this.doCopyClassSettings = false;
if (cc != null)
{
this.doCopyClassSettings = true;
if (cache.GetStatus(row) != PXEntryStatus.Inserted)
{
if (BAccount.Ask(Messages.Warning, Messages.CustomerClassChangeWarning, MessageButtons.YesNo) == WebDialogResult.No)
{
this.doCopyClassSettings = false;
}
}
}
}

Is there a way to specify which button (Yes/No) should be the default?

 

Thanks,

Phil

icon

Best answer by Vinay Koppula 4 July 2022, 08:23

View original

6 replies

Userlevel 5
Badge +2

@pjpowell The default selection in this dialog is made by the framework behind the scenes:
 

The code you found, is one of the events that is triggered when the Customer Class is changed and that code sets the logic to display or not the above dialog depending if the customer already exists or not. The code does not set the default answer button.

@Dioris Aguilar Thanks for the information.  Does this mean it’s not possible to change the default button or simply that I’m looking in the wrong place to do so?

 

Thanks,

 

Phil 

Userlevel 5
Badge +2

@pjpowell It’s not possible, at least using standard customization procedures. Maybe some custom javascript code could do the trick.

Userlevel 5
Badge +1

@pjpowell As an alternative, you can add a custom popup with custom buttons in it. 

@Vinay Koppula   I had also thought about changing the message text and the behaviour to set to false when the user clicks yes as that is the default but I would prefer not to change the behaviour if possible. How would I go about popping up my own message dialog?

 

Phil

Userlevel 5
Badge +1

@pjpowell you can follow the below post which will help you to create your own message dialog pop-up (smart panel)

https://asiablog.acumatica.com/2015/11/using-smart-panel.html

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved