Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Server Code and Pointers Error

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 :)

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

Server Code and Pointers Error

Addy,

Glad to hear you solved it :)

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Server Code and Pointers Error

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

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Server Code and Pointers Error

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Server Code and Pointers Error

Hello Eric,

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

Samantha Joy Tabago
Posts: 0
Joined: Mon Oct 02, 2017 5:51 am

Server Code and Pointers Error

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!!

Samantha Joy Tabago
Posts: 0
Joined: Mon Oct 02, 2017 5:51 am

Server Code and Pointers Error

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!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Server Code and Pointers Error

Hello Samantha,

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

Return to “Issues”