I want to retrieve the value of GCV that is configured in User Application Driver, on click of Request Form Submit Button.
For this, I write the following code inside Form Control Script as inline script.
Code:
var ACTION_SUBMIT = "SubmitAction";
function onload_form( form, IDVault, GCV )
{
    form.interceptAction( ACTION_SUBMIT, "around", function ( invocation ) {
    	try {
      		function submit_form() {
	            var onlySpacRegx = /^\s*$/;
	            var reason_txt = form.getValue('reason');
	            if(onlySpacRegx.test(reason_txt)) {
	            	alert("Justification has only whitespaces or no value.\n Pleas provide the valid justification.");
	                return;
	            }
	            var specialCharFilter = '[#$~]+';
	            if(reason_txt.search(specialCharFilter) >= 0) {
	                alert("Don't use '#' (hash), '$' (dollar) and '~' (tilda) in 'Justification'.\n Please remove above characters & submit again. ")
	                return false;
	            }
	            if(confirm("You have clicked on 'Submit'. \nPress 'OK' to confirm.")) {
	                return invocation.proceed();
	            }
	            return false;
            }
			function getData() {
				var userDN = form.getValue("User");
				var propFilePath = GCV.get('PropFilePath');
				alert("propFilePath : "+propFilePath);
			}
			getData();
            submit_form();
		}
        catch(e) {
        	alert("Error : "+e);
        }
   });
}
Added the following code inside Form Control Events as onload event.
Code:
onload_form( form, IDVault, GCV );
But when I open my workflow, It gives me the following error on load of Request Form.
Code:
An error 'ReferenceError: GCV is not defined' was encountered while executing the script 'onload_form( form, IDVault, GCV );'
An error 'ReferenceError: GCV is not defined' was encountered while executing the script 'onload_form( form, IDVault, GCV );'
Unrecoverable error during asynchronous call (GCV is not defined)
I can able to get the value of GCV on Mapping Activity by using
Code:
GCV.get('PropFilePath')
But I want to get this value on click of Submit Button.
So please help me to fix this.