The script is here and the description/breakdown follows:
Here are the notes:
- The section in red: This is where the developer will add the required fields into the array. Each field added needs to increment the array index or it will over write. The names put in the required field area are the Dashboard prompt captions.
- The sections in blue: This section is for the time field validation. This checks that at least one time field is populated with data. It also highlights the errMsg used.
- The sections in purple: This is where a developer can use as a template to create the scenario like time where ‘at least’ one field needs to be used.
- The sections in green: This is the additional code which sets the prompts’ scope for the page to the first prompt’s scope. So if the first prompt’s scope is page, all the prompts for the entire page will share the same scope else the entire pages prompts use dashboard scope.
Here is a screen shot of it working within SampleSales. One of the required fields is selected (Brand). And as you can see the alert is shown signifying to the user that ‘at least one time field’ and ‘Region’ are required. The report is not fired for these prompts until all required validation is met.
Until next time…I am currently working on script to stop the dashboard page from firing off report queries on entry. Almost complete this should be added shortly.