Creating a Popup screen using the Client Side API

1 minute read time.

I have written before about adding buttons to a page using the Client Side API in Sage CRM. See the articles

These articles show how easy it is to add buttons to the interface that can call new behaviour. But my articles made the two assumptions. The first is that when calling an ASP or a .NET Page from a button this would replace the existing page with the newly called page, so the button in other words navigates the user to that new page. The other assumption is that when calling an external web page you would want to pop up the page into a little window.

The missing piece is how to call an ASP page or .NET assembly in a popup window like below.

The following code was responsible for the button.

[code language="javascript"]

[/code]

The important element with the code is the way in which the URL has been built.

var stringURL = crm.url("testpage.asp")+" &PopupWin=Y";

The flag &PopupWin=Y tells Sage CRM not to draw the Main Menu and TopContent including the Tab Menu for the page. This makes the assumption that the page that you are calling is generating its code using the CRM.AddContent() and CRM.GetPage() methods.

Anonymous
  • Michele

    You need to check the help guide for the COM API Button method: help.sagecrm.com/.../AS_CRMBaseButton.htm

    It will look like

    var strMyWebApp = CRM.Button("Web App", "preparedatabase.gif", CRM.URL('WebApp/Default.aspx')+"&PopupWin=Y", "", "", "My Window");

  • Jeff: I would really like to have one of these popup windows for a WebApp that we created. The WebApp is accessed off a button in Sage CRM. I tried adding +"&PopupWin=Y" to my button but I don't get a pop up window. The system just goes to the new page. Therefore, I don't think I am putting this in the correct place.

    This is what I have tried...

    var strMyWebApp = CRM.Button('Web App','preparedatabase.gif', CRM.URL('WebApp/Default.aspx')+"&PopupWin=Y");

    Container.AddButton(strMyWebApp);

    OR

    var strMyWebApp = CRM.Button('Web App','preparedatabase.gif', CRM.URL('WebApp/Default.aspx'));

    Container.AddButton(strMyWebApp)+"&PopupWin=Y";

    Am I doing something wrong here? Any assistance you could provide would be greatly appreciated!!

    Thank you!