I have written before about adding buttons to a page using the Client Side API in Sage CRM. See the articles
- Adding a Print Screen button to a system page using the client side API
- Calling extensions (ASP pages and .NET assemblies) from buttons added using the client side API
- Controlling the properties of New Buttons adding using the Client Side API
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.
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.