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

KB20176: How to Answer only the Required Prompts with the Default Answers When all Prompts are Provided with Default Answers Using the MicroStrategy SDK 10.x


Community Admin

• Strategy


To answer only the required prompts with the default answers when all prompts are provided with default answers, follow the following logic.

To answer only the required prompts with the default answers when all prompts are provided with default answers, follow the following logic.
 
1. Instantiate a prompt object 
 


WebPrompts prompts = theReportBean.getReportInstance().getPrompts();
theReportBean.collectData();

 
 
2. Inside a for loop that goes thrugh the WebPrompts object above, implement the following logic.

WebPrompt prompt = prompts.get(index);
if (prompt == null) return;
else {
 if (!prompt.isClosed()) {
  if (!prompt.isRequired()) {
   //The code below tells the WebPrompts object not to answer this prompt when .answerPrompts() are called.
   prompt.setClosed(false);
  }
 }
}
}

3. Add the following line after the 'for loop' so the prompts get answered.

prompts.answerPrompts();

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. 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:

June 5, 2017

Last Updated:

June 22, 2017