EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB221321: How to Add Custom JavaScript to MicroStrategy Web Pages in MicroStrategy Web SDK 9.4.1


Community Admin

• Strategy


Some customizations require the use of JavaScript to be included on a MicroStrategy Web page. The plug-in architecture provided by MicroStrategy Web can be used to achieve this purpose. The rules for adding JavaScript to a page are as follows.

Adding Custom JavaScript
Some customizations require the use of JavaScript to be included on a Strategy Web page. The plug-in architecture provided by Strategy Web can be used to achieve this purpose. The rules for adding JavaScript to a page are as follows.

  1. The JavaScript should be included in its own file rather than including it directly on a Strategy Web page.
  2. The JavaScript file should be inside the "javascript" folder of the customization plug-in.
  3. The JavaScript file should follow a naming convention such that the name of the file is [Name of the page].js where [Name of the page] is the Strategy Web page on which the JavaScript should be executed. For example, JavaScript to be included on a Report Execution page should in reportPage.js, while JavaScript to be included on the Folder Browsing page should be sharedPage.js. The naming convention is important as Strategy Web will dynamically load these javascript files based on the page referenced in the file name. Use the Web Customization Editor to find out the name of the Strategy Web page.
  4. To execute the JavaScript on all or majority of Strategy Web pages (such as Prompt or Subscription pages), the JavaScript file should be named global.js. It is recommended to use a condition in global.js so that the JavaScript is executed only on those Strategy Web pages where the condition is met.

 
Using the Web Customization Editor to create a plug-in for JavaScript customizations
Strategy SDK provides a Web Customization Editor that can be used to create a customization plug-in. The following steps guide user in creating the plug-in for adding custom JavaScript to a Strategy page.

  1. Launch the Web Customization Editor.
  2. Create a new plug-in and give it a meaningful name. (For step by step instructions on creating a new plug-in, please navigate toHome > Web SDK > Customizing Strategy Web > Web Customization Editor > Features and Customizable)
  3. Click in Strategy Web Configurationin Application Settings view to expand the hierarchical tree.
  4. Navigate to Pages.
  5. Right click on the desired page and select “Create new Javascript”.
ka04W000000OhEGQA0_0EM440000002GQM.jpeg

 
This will generate a new file in your plugins folder (plugins/pluginName/javascript) with the following naming convention: [Name of the page]Page.js where [Name of the page] is the Strategy Web page on which the JavaScript should be executed

  1. Add the custom JavaScript to the file in the WCE.
  2. Save the changes and restart your Web Server.

 
Note: Though developers may add their own custom JavaScript to Strategy pages, Technical Support does not help troubleshoot JavaScript customizations.
 
 
ADDITIONAL INFORMATION:
The Strategy SDK allows you to customize the standard Strategy Web interface, and extend and integrate the Strategy business intelligence functionality into other applications. However, before changing the way Strategy Web products look or behave, it is helpful to understand how the application is built. For more information regarding the Strategy Web architecture or the process of customizing Strategy Web, please refer to Strategy Developer Zone (https://resource.microstrategy.com/msdz/).
To access the Strategy Developer Zone, you must have access to the Strategy Knowledge Base, you must have purchased the Strategy SDK, and you must be current on your Strategy maintenance agreement. If you are a US-based business and believe that you satisfy all three of these conditions but you do not have access to the Strategy Developer Zone, please contact Strategy Technical Support at support@microstrategy.com or at (703) 848-8700. If you are an international business, please contact Strategy Technical Support at the appropriate email address or phone number found at http://www.microstrategy.com/Support/ContactUs.asp.
 
 
CUSTOMIZATION WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.


Comment

0 comments

Details

Knowledge Article

Published:

May 30, 2017

Last Updated:

May 30, 2017