Author Topic: Work arounds on date prompts  (Read 419 times)

Offline sriYA

  • Associate
  • **
  • Join Date: Jul 2018
  • Posts: 1
  • Forum Citizenship: +0/-0
Work arounds on date prompts
« on: 16 Jun 2020 09:25:59 am »
I need some help with dates

There is a date prompt on a report.
•   When the user enters a custom date the report should display prompt date.
•   When the user leaves the date blank on the prompt page then it should pick up the data item value from the report.

I used Case when ?promptDt? is null then [Invoice_Date] else ?propmtDt? end

My issue is, as soon as I add this code the date on the prompt page turns into mandatory.
The users want this to be blank.

TIA

Offline hespora

  • Statesman
  • ******
  • Join Date: Nov 2015
  • Posts: 393
  • Forum Citizenship: +22/-0
Re: Work arounds on date prompts
« Reply #1 on: 18 Jun 2020 10:31:03 am »
Using the ?name? syntax to reference parameters will indeed make the corresponding prompts mandatory. You need a prompt macro with default value instead.

Change your data item to:

Code: [Select]
#prompt( 'promptDt', 'token', '[Invoice_Date]' )#

Offline Cape Cod Gunny

  • Full Member
  • ***
  • Join Date: Sep 2015
  • Posts: 33
  • Forum Citizenship: +0/-0
    • How to Get Out of Debt and Achieve Financial Success One Debt at a Time
Re: Work arounds on date prompts
« Reply #2 on: 23 Jun 2020 08:37:24 am »
You could create a prompt page with a single Date Prompt. Set Date Prompt Required = False. Filter the report using the Date=?Date Prompt? and make the filter "optional".
Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"

Offline hespora

  • Statesman
  • ******
  • Join Date: Nov 2015
  • Posts: 393
  • Forum Citizenship: +22/-0
Re: Work arounds on date prompts
« Reply #3 on: 24 Jun 2020 02:40:32 am »
His/her usage of the parameter was in a data item rather than a filter. There's no making those optional. ;)

Offline aetcognos

  • Full Member
  • ***
  • Join Date: Feb 2006
  • Posts: 14
  • Forum Citizenship: +0/-0
Re: Work arounds on date prompts
« Reply #4 on: 26 Jun 2020 04:56:49 pm »
Using the ?name? syntax to reference parameters will indeed make the corresponding prompts mandatory. You need a prompt macro with default value instead.

Change your data item to:

Code: [Select]
#prompt( 'promptDt', 'token', '[Invoice_Date]' )#

Yes this should work, although I would change it to date instead of token, and you would get an optional date prompt when viewing tabular data or  running a report.

Code: [Select]
#prompt( 'promptDt', 'date', '[Invoice_Date]' )#

 



       
Twittear