Reputation: 187
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;
}
}
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!
Upvotes: 1
Views: 92
Reputation: 1839
In your graph extension, check for the flag Base.IsMobile. You could use that to branch your logic
Upvotes: 1