OnLoad not running part of the script

Document ID : KB000106294
Last Modified Date : 13/07/2018
Show Technical Document Details
A script that runs OnLoad is only running in partial. This same script works in 14.1 works completely, when not running OnLoad the script runs completely. Refer to screenshots. The folder offering that contains this form will be uploaded as well.
This may be a timing issue.
While it may not always solve the problem this can sometimes be solved by setting the scope and then switching to that scope.
For example:

onLoadFormCommon : function(){ 
departmentcostcenterhidden = false; 
var scope = ca_fd.fdScope; 
var formid = ca_fd.formId; 
setTimeout( function(){