Bikash Lama
Bikash Lama

Reputation: 187

Prevent loading popup in mobile

I have override the CustomerID's Field Updated event in Sales Order page that displays a popup with the custom field UsrCustomerNote for update purpose. It is working fine on web. But, the thing is I want to prevent popup in acumatica mobile app. How do I do this? Here is the code that loads the popup.

            BAccountEnq bAccountEnq = PXGraph.CreateInstance<BAccountEnq>();
            BAccount bAccount = PXSelect<BAccount, Where<BAccount.bAccountID, Equal<Required<BAccount.bAccountID>>>>.Select(bAccountEnq, row.CustomerID);
            var customerNote = (string)bAccount.GetExtension<PX.Objects.CR.BAccountExt>().UsrCustomerNote;
            if (!string.IsNullOrEmpty(customerNote))
            {
                if (CustomerSelector.AskExt(
                delegate
                {

                    CustomerSelector.Current.GetExtension<PX.Objects.CR.BAccountExt>().UsrCustomerNote = customerNote;
                    CustomerSelector.Cache.Update(CustomerSelector.Current);

                }) == WebDialogResult.OK)
                {
                    IsOKToUpdate = true;
                }
            }

Here is how it looks on web: enter image description here

And, here is the error that is caused by popup.

I want this customization on web but not on mobile keeping the Base method for Field Updated event. I mean like not completely disabling the event but only preventing popup to load if it's in mobile.

Thanks!

enter image description here

Upvotes: 1

Views: 92

Answers (1)

Simon ML
Simon ML

Reputation: 1839

In your graph extension, check for the flag Base.IsMobile. You could use that to branch your logic

Upvotes: 1

Related Questions