acumatica

Use button with callto link


Origine message is : I would like to optimize the code below because acumatica open a new window when the callto function is called. I want to Just execute callto without open a New Windows ?

  [PXUIField(DisplayName = "Tel1",
  MapEnableRights = PXCacheRights.Select,
  MapViewRights = PXCacheRights.Select)]
  [PXButton(ImageKey = PX.Web.UI.Sprite.Main.World)]

  protected virtual IEnumerable tel1 (PXAdapter adapter)
  {
    string tel1="callto:06XXXXXXXX";        
    throw new PXException("Redirect4:"+string.Format(tel1));
    return adapter.Get();
  }    

Update of the message : I would like not have the about:blank in the picture below, but I would like have only the 3CXPhone windows.

enter image description here


Solution

  • I utilized the following code to add a button on AP301000 which redirects to 'callto:' opening whatever associated program you have set ( mine opened teams ) for web calling.

    public class AAAPInvoiceEntry_Redirect : PXGraphExtension<APInvoiceEntry>
    {
        public PXAction<APInvoice> AATel1;
    
        [PXUIField(DisplayName = "Tel1", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
        [PXButton(CommitChanges = true)]
        public virtual IEnumerable aAtel1(PXAdapter adapter)
        {
            string tel1 = "callto:06XXXXXXXX";
            throw new Exception("Redirect0:" + string.Format(tel1));
        }
    }