The basic key here is to add { buffer: false, escape: true, timeout: 30000 }
What this does is that it won't allow remote manager wouldn't to batch up the remoting calls. Why this is essential is because sometimes we don't have data to transfer to a remoting function when bootstrapping happens for JS code resulting in irregular objects being passed to remoting calls and thus the above error.
Incase wondering where to add it:
scope.getParentId = function() {
EsignCongaSigningUrlRemoting.getEsignUrlParentIdFromObjectId($scope.objectId, 1, function(response, event) {
if(event.status) {
console.log('parentId in response = ',response);
$scope.parentId = response;
$scope.signingUrl($scope.parentId);
}
else {
$scope.parentId = '';
}
},{ buffer: false, escape: true, timeout: 30000 });
};
To learn in-depth about Workflow in Salesforce, sign up for an industry-based Salesforce Certification!