Page 3 of 3

Server Code and Pointers Error

Posted: Mon Jul 07, 2014 7:34 am
by Bad Addy

Yeah, thank you Katya, but I was constantly getting errors using:

prerequest.object().groupTypeID;/pre

So I ended up changing the POST to GET, and it worked fine :)


Server Code and Pointers Error

Posted: Mon Jul 07, 2014 7:52 am
by Kateryna Grynko

Addy,

Glad to hear you solved it :)


Server Code and Pointers Error

Posted: Sat Mar 07, 2015 6:24 am
by EJLD

Hi there, it must very simple too but very new with server code. like your lights pls.

1/ there are several queries one after the other,
2/ the record (object) of what is the criteria doesn't always exist,

the result is when the object cannot be found, the rest of the script is not processed.
as you can see on the trace, it runs query0 but when the result of the query1 comes up "empty" then it stops.

Image

here after is my code, may I ask you what extra instruction I shld insert to handle the error thrown as the query1 comes out empty ?

// QUERY 1 to retrieve the userNotes
var param1 = {}; //Define parameters object
param1.criteria = { //Query criteria:
$and:[{"userName": userName},{"countryID":countryIdfull}]
};

var query1 = Collection.query(DB_id, collBknotUserNotes, param1);
console.log("param1 = ");
console.log(JSON.stringify(param1));
console.log("query1 = ");
console.log(JSON.stringify(query1));

var countryId = query1[0][colmCountryID];
console.log("countryId ="+countryId);
var bknoteUserNotes = query1[0][colmUserNotes];
console.log("bknoteUserNotes ="+bknoteUserNotes);

thk you very much in advance
Best
Eric


Server Code and Pointers Error

Posted: Sun Mar 08, 2015 12:58 pm
by EJLD

In fact, I could manage to handle the empty result and get the response as expected. Happy ! :)
hv a good week. Eric


Server Code and Pointers Error

Posted: Sun Mar 08, 2015 3:39 pm
by Evgene Karachevtsev

Hello Eric,

Thank you for the update! Have a good week too :)


Server Code and Pointers Error

Posted: Mon Oct 02, 2017 5:51 am
by Samantha Joy Tabago

Hi! I'm getting the error "": ApperyioAPI: Empty objects can't be created. Please specify at least one field.

I tried what was said above and couldn't understand the part where I must create function for users?

Please reply asap and thank you!!


Server Code and Pointers Error

Posted: Mon Oct 02, 2017 6:32 am
by Samantha Joy Tabago

Also there is no data tab in the latest appery io today so how can i add a data source such as a service? Thanks again!


Server Code and Pointers Error

Posted: Mon Oct 02, 2017 12:29 pm
by Serhii Kulibaba

Hello Samantha,

Could you please provide us with more details, screenshots or exact steps to reproduce this problem?