Page 1 of 1

Executing a service via js - no method/property execute

Posted: Sat Apr 20, 2013 10:29 pm
by dale

Having an issue where I cannot call a service via JS with .execute.

GeolocationService.execute({});

I get the following errors:
Chrome - Uncaught TypeError: Object [object Object] has no method 'execute'
IE - Object doesn't support property or method 'execute'

Thanks,

Dale.


Executing a service via js - no method/property execute

Posted: Sat Apr 20, 2013 10:30 pm
by maxkatz

What is the name of your service on the page (in mapping)? You would call:

code
serviceInstanceName.execute ({});
/code


Executing a service via js - no method/property execute

Posted: Sat Apr 20, 2013 10:34 pm
by dale

Ah, wouldn't you know it - I posted this and then a minute later found the solution!

You don't use the service name on LHS, it works if you use the name from the 'datasource' dropdown.