Skip to main content
Answer

Show Error/Warning Message

  • October 2, 2023
  • 2 replies
  • 777 views

Forum|alt.badge.img

Hi Team,

Can someone tell me how to show Error/Warning message box?

Here is my code

protected void HMRCAPIConfigDetail_Active_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {

            var row = (HMRCAPIConfigDetail)e.Row;
            var activeAPIConfigs = ActiveAPIConfigs;
            if(activeAPIConfigs != null)
            {
                row.Active = false;
                throw new PXException(Messages.APIActiveErrorMessage);
            }

        }

Thanks

Best answer by praveenpo

Hi @bhagyat25 ,

Here is the sample code to display pop up message.

WebDialogResult result = <ViewName>.Ask(ActionsMessages.Warning, PXMessages.LocalizeFormatNoPrefix("My Message"),
                MessageButtons.OKCancel, MessageIcon.Warning, true);
            //checking answer    
            if (result != WebDialogResult.OK) return;

2 replies

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Answer
  • October 2, 2023

Hi @bhagyat25 ,

Here is the sample code to display pop up message.

WebDialogResult result = <ViewName>.Ask(ActionsMessages.Warning, PXMessages.LocalizeFormatNoPrefix("My Message"),
                MessageButtons.OKCancel, MessageIcon.Warning, true);
            //checking answer    
            if (result != WebDialogResult.OK) return;


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • October 18, 2023

Hi @bhagyat25 ,

Here is the sample code to display pop up message.

WebDialogResult result = <ViewName>.Ask(ActionsMessages.Warning, PXMessages.LocalizeFormatNoPrefix("My Message"),
                MessageButtons.OKCancel, MessageIcon.Warning, true);
            //checking answer    
            if (result != WebDialogResult.OK) return;

Hi Praveen,

I already applied that but the problem is only one time that message comes. For the next error message that popup is not comming.