Global Action not working

I have created a global action on a table. The action calls a snippet which I have defined in the Resources tab. When I click on the Action button, nothing seems to happen. I have also added an alert() code in the snippet to check if the snippet gets called at all. But nothing happens. Any suggestions to solve this problem? 

Thanks in advance

Can you click on “F12” and look at console. Is it throwing any error?

Thanks,
Goutham

I opened the console with cmd + Space –> console. I cannot see any errors thrown in the console window.

Checking a simple thing: make sure the name of your snippet is the same as the name that you entered in the global action settings.

Thanks for the suggestion Matt. It is the same name. In fact, I just copied the name of the snippet and pasted it in the global action settings. No change to the result. 

Hi Namrata,

What is the “Resource Location” property set to on your snippet? Also, can you paste the actual contents of your snippet?

Ben,

Resource Location Property is In-Line(Snippet). Here is the content of the snippet. The alert code is there to check if the Snippet gets called. The snippet calls fetches data from Yodlee and saves it in application model.

var appModel = skuid.model.getModel(‘applicationYod’);
var appRow = appModel.data[0];
alert(“callYodlee Snippet called”);
var result = sforce.apex.execute(‘SkuidYodleeCallCtrl’,‘doYodleeCallForParty’,
    {   
        applicationId : appRow.Id,
        partyId : appRow.Contact__c
    });

alert(result);
window.location.reload();

Thanks,
Namrata

Hmm, everything looks totally fine to me. I’m baffled if you’re not getting any javascript errors. Can you grant login access to skuid following these instructions?

sure I can do that… I am uploading a screen shot. After I read your comment, I opened Inspect element –> console and I see these errors…I had opened the CMD + SPACE –> console, but that didn’t give any errors.

var appModel = skuid.model.getModel(‘applicationYod’);

That line is returning null. Make sure you have a model named ‘applicationYod’

Also, in general, .getFirstRow() is better than .data[0]

Yeah Matt is right, can’t read property ‘data’ of undefined most likely means your getModel call is not returning a model. Make sure your ‘applicationYod’ is the exact, case sensitive name of your model.

Thank you for the suggestion Matt. The snippet gets called. But now it throws another error.

Uncaught TypeError: Cannot read property ‘push’ of undefined

XMLHttpRequest cannot load https://na34.salesforce.com/_ui/common/request/servlet/JsLoggingServlet. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://genesisextn.na34.visual.force.com’ is therefore not allowed access.

What should I look at to resolve this issue? Thanks again for your comments.