Field Control beffore insert/Update Records


Hi Everybody,

I want to know how I can check the existence of a client identifier in my database before adding a new client , for not having data redundancy.



I couldn’t do it in a single server call, as the server side scripting breaks if there is no session, so I resorted to a multi-call routine.

First I request a session_id with @"/user/session" passing in the user’s name & password, if I get a session back it means the user exists, if no session return then I create a new user with @"/user/register" and get a session_id back, if the new user creation fails then there is either a network error or similar.

Hope that helps, would be great if somebody can show me a way to do this in a single call to speed sign-in/up and reduce network calls.