Hey everyone! Long time lurker, first time poster, and all of that jazz.
I am attempting to use Custom Control Javascript in an Interactive Report to auto-submit a hidden prompt page. I obtained a piece of Javascript from a post on this site (If I could remember the username, I'd give them props) and tried it out but I feel like I am missing something. I've included the JS file at the bottom of this message. For the sake of providing screenshots, I have removed the piece of code that hides the prompt page just so the values can be seen. I've tried to include several screenshots as well.
I have a prompt page

with two Value Prompts that are being populated with default values by using a query that calculates the end of the previous month and a default category called View (
this one is not giving me troubles). The idea is that the report will run, the query will execute and populate the value prompts, the two associated parameters (
PeriodEndDate and View) will now have a value in them, and then the main report will receive those once the auto-submit has taken place.
The problem is that the value Prompt that receives the End of the month value from the query and populates the PeriodEndDate parameter is not doing that. As a test, I updated the prompt page to display the value of the PeriodEndDate parameter. At run time and before the Auto-submit timer runs out, there is not a value for the parameter -

Once the page auto-submits, it takes me to a prompt page to provide a value for the parameter PeriodEndDate even though the value prompt SHOULD have received this from the query.

Is there anything in the Javascript that needs to be updated in order to populate the value prompt so that the PeriodEndDate parameter has its value?
As promised, here is the JS that I found on Cognoise. Thanks in advance everyone!
define( function() {
"use strict";
document.head.appendChild( document.createElement( "STYLE" ) ).innerHTML =
"TABLE.clsViewerProgress," +
"TABLE.clsViewerProgress *" +
"{" +
"visibility: hidden !important;" +
"}";
function Control()
{
};
Control.prototype.show = function( oControlHost )
{
var fDefaultSeconds = 0.05;
var fSeconds = ( oControlHost.configuration ? oControlHost.configuration.Seconds : fDefaultSeconds ) || fDefaultSeconds;
this.m_iTimer = setTimeout( oControlHost.finish.bind( oControlHost ), Math.round( fSeconds * 1000 ) );
};
Control.prototype.hide = function( oControlHost )
{
this.cancelRefreshTimer();
};
Control.prototype.destroy = function( oControlHost )
{
this.cancelRefreshTimer();
};
Control.prototype.getParameters = function( oControlHost )
{
// WARNING: Do not remove this method.
// Pages that don't contain prompt controls are cached by the viewer. The existence of a getParameters
// is used as the indicator that the custom control is prompt-like and will prevent caching.
};
Control.prototype.cancelRefreshTimer = function()
{
if ( this.m_iTimer )
{
clearTimeout( this.m_iTimer );
this.m_iTimer = null;
}
};
return Control;
});