If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Prompt API. Is possible to get previously submitted value?

Started by patrickthatcher, 12 Aug 2015 02:10:10 PM

Previous topic - Next topic

patrickthatcher

I have code for a drop-down prompt to set the value to the first record when the prompt is displayed.  If the user submits the report and then decides to rerun the report, understandably, the drop-down always goes back to first record versus what they might have previously selected.  Is there a way determine if the drop-down had a previous value? If I disable the code and run it, what I previously had chosen does display as expected.

thank you


<script>
//<!–
//This will set the default value to the first entry

//get report
var oCR = cognos.Report.getReport("_THIS_");

var oP = oCR.prompt.getControlByName("P1DailyDate");


  // Get the values and isolate the first value.
  var allValues = oP.getValues(true);
  var firstValue = allValues[0];

  // Set the prompt selection to the first value.
  oValues = [firstValue];
  oP.setValues(oValues);

//–>
</script>