Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I'm using Visualforce Remoting for an application, and periodically getting the error:

Uncaught TypeError: Cannot read property 'tid' of undefined, from line 84 of the VFRemote.js library file.

The file is auto-loaded into my page by my controller defining Remote Actions.

https://c.na4.visual.force.com/jslibrary/1383366200000/sfdc/VFRemote.js (I'm aware of the note at the top, but not including this script directly in my page.)

I'm not clear what's causing this. If I update my Application Cache Manifest, it will cue a refresh of the page, and then the error disappears.

Any thoughts? Is it a problem with the manifest?

1 Answer

0 votes
by (32.1k points)
edited by

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! 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...