I'm developing a SP2013 office 365 app using the Sharepoint hosted option so working with JS.
I'm allowing users to create new records in a list and also displaying that list of records that are created.
I need only records created by that user to be displayed to them...currently everyone see's every record. I know how to filter on the list programmatically but not sure how to do it using the user credentials...
MORE INFO
Ok managed to move things on and I'm now pretty close the solution...
When you read the list in you use the CamlQuery option as follows.
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Author' /><Value Type='Text'>" + fullUserName + "</Value></Eq></Where></Query></View>");
Points to note is the Created By is actually Author!
What I'm now unsure of is what is stored in the created by? Is it just the users name or name and ID? Can't get the query to work when using the name..anyone know?