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.
Answer
What is the best suggessted code to alert user by pop-up msg?
Best answer by aleksejslusar19
Hi
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
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.