Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Executing service problem

I am attempting to get a total count of records from a service query. I am having issues with my execution order and understanding things well enough to get what I need. I either get a service fail or a script fail

Within a popup I have script:
saddleCountSearch.execute({ "data" : {"where": '{"maker":"Albion"}'}});
console.log('query attempted'); //this happens
var count=data.length; //this appears to be my fail point
localStorage.setItem("total",count); //this does not happen
console.log('search count-on page'); //this does not happen

then on the data side of things I have on success of saddleCountSearch the following code:
var count2 = data.length;
console.log(count2);

I get a value for count2 which is valid but I get an error for trying to set count on popup. If I comment out the line var count... on the executing popup, the service fails and I obviously have no count2 value.

error when success is true is:
Uncaught ReferenceError: data is not defined
$.die.live.click
jQuery.event.dispatch jquery-1.8.2.js:3063
elemData.handle.eventHandle

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Executing service problem

Hi Sean,

Variable "data" is created by Tiggzi only in Success event.

For this codecodevar count=data.length;/code"data" variable is not defined.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Executing service problem

that makes sense. how come when I comment the line out the error event happens?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Executing service problem

The error is in the following line:codevar count=data.length; //this appears to be my fail point/code
You should comment the line this waycode//var count=data.length; //this appears to be my fail point/codeor just delete it.
Does the error still appear?

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Executing service problem

this is all I have now:
saddleCountSearch.execute({ "data" : {"where": '{"maker":"Albion"}'}});

the success event is no longer triggered

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Executing service problem

Please share your app with a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Executing service problem

Thanks for your help- I decided to move the execution of the service from the popup to the originating page and that worked. I do not know if that was the problem or if I had another problem that resolved itself through fresher eyes.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Executing service problem

Ok, glad it's working now.

Return to “Issues”