What I am looking to do is simple, I want to have a workspace item which, when clicked, opens an external URL I specify in the same tab.
Note : I do not want the external website to be embedded in my Acumatica screen(The external website doesn’t support that).
I’ve tried several different things, but none have quite worked.
One approach I took is creating a new Screen and then adding in the below code to the aspx.cs code behind file’s Page_Load callback. This got me very close but there is a pesky popup message when I try opening the page before the redirect happens.
protected void Page_Load(object sender, EventArgs e)
{
System.Web.HttpContext context = System.Web.HttpContext.Current;
String url = "https://www.acumatica.com";
context.Response.Clear();
context.Response.Write("<script language=javascript>");
context.Response.Write(String.Format("window.open(\"{0}\",\"{1}\");", url, "_top"));
context.Response.Write("</script>");
context.Response.Cache.SetNoStore();
context.Response.Cache.SetNoServerCaching();
context.Response.End();
}
Here is the problem popup message I’m seeing
After I click okay the correct screen then opens up. Also the above message doesn’t always popup, it seems to popup every other time I click on the Workspace item for some strange reason.
If anyone has any suggestions I’d appreciate your thoughts,
Philip Engesser
Best answer by Mike Gifford
View original