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
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:
#prompt( 'promptDt', 'token', '[Invoice_Date]' )#
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".
His/her usage of the parameter was in a data item rather than a filter. There's no making those optional. ;)
Quote from: hespora 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:
#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.
#prompt( 'promptDt', 'date', '[Invoice_Date]' )#