Skip to main content
Answer

What is the best suggessted code to alert user by pop-up msg?

  • November 3, 2025
  • 1 reply
  • 37 views

Forum|alt.badge.img+6

Hello,  Currently I am using the cache.RaiseExceptionHandling method to alert user , code like below:
        
  if ((avgWeight != conversionFactor) || (avgWeight == null && conversionFactor != null) || (avgWeight != null && conversionFactor == null))
          {
             cache.RaiseExceptionHandling<InventoryItemExt.usrAverageWgt>(row,
             rowExt.UsrAverageWgt, new PXSetPropertyException("Always remember to set it same as conversion rate", PXErrorLevel.Error));

          }

For some reason, the users are wish to be alerted by pop-up msg.

        What is Acumaitca’s best practice, if I want to only replace the code in black.

Best answer by aleksejslusar19

Hi ​@ray20 
You can display the dialog box (PXSmartPanel) with one or more choices for the user in the following way:
 

 if ((avgWeight != conversionFactor) || (avgWeight == null && conversionFactor != null) || (avgWeight != null && conversionFactor == null))
{
if (YouMainGraphView.Ask("Message box header",
"Message box text",
MessageButtons.OKCancel,
true) == WebDialogResult.OK)
{
//Your business logic for OK answer
}
else
{
//Your business logic for Cancel answer
}
}


 

1 reply

Forum|alt.badge.img+1
  • Jr Varsity III
  • Answer
  • November 3, 2025

Hi ​@ray20 
You can display the dialog box (PXSmartPanel) with one or more choices for the user in the following way:
 

 if ((avgWeight != conversionFactor) || (avgWeight == null && conversionFactor != null) || (avgWeight != null && conversionFactor == null))
{
if (YouMainGraphView.Ask("Message box header",
"Message box text",
MessageButtons.OKCancel,
true) == WebDialogResult.OK)
{
//Your business logic for OK answer
}
else
{
//Your business logic for Cancel answer
}
}