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

Javascript in a Job 10.2 API

Started by tommeyers, 06 Mar 2017 03:53:28 PM

Previous topic - Next topic

tommeyers

I have a javascript on my parameter page that sets a fromdate prompt and todate prompt as the value changes in a drop down (lastmonth, ytd, today, ...); it works well except when I want to use it in a job.

The two date prompts are mandatory so I can't use logic in the report to choose them.   When the report runs the date values need to be set need to be set.

I want to choose the dropdown value in the job and have the two date values set when the report queries run.

Currently I am changing the from and to dates every month. OK, but time consuming and errors are easy.

I do not have access to the FM model. (eClinical is the package).

I am stuck, Tom Meyers

rockytopmark

Have you considered using prompt macros?  You don't indicate how your parameters are being used in the report.... filters?  MUNs?

If you have a simple detail filter such as:  [someQS].[someDateItem] = ?fromDate?

Change it to use the prompt macro... something along the lines of:

[someQuerySubject].[someDateItem] = #prompt('fromDate','date',<some code (similar to whats in your javascript) that returns the default date>)#

For example... #prompt('fromDate','date',_first_of_month ($current_timestamp))# returns the 1st of the current month.

tommeyers

Thank you for this idea.  I will try that and report back.

Tom