function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
If it helps mark it as best answer.
Thanks!
All Answers
Thanks!
global public class Rest_UserLogin {
@HttpGet
global static List<User_Login__c> getLogins(){
List<User_Login__c> userlogins = [SELECT Id,CreateDate, Session_Length__c,Contact__r.Email From User_Login__c ];
return userlogins;
}
@HttpPost
global static void createNewLoginRecord(string systemName,string userEmail,Integer sessionLength){
Contact c=null;
try{
c=[SELECT Id,Email FROM Contact WHERE Email =: userEmail].get(0);
User_Login__c userLogin = new User_Login__c ();
userLogin.System_Name__c=systemName;
userLogin.Contact__c=c.Id;
userLogin.Session_Length__c= sessionLength;
insert userLogin;
RestContext.response.responseBody = Blob.valueOf('Success:Record created with id' +userLogin.id);
}
catch(Exception e){
RestContext.response.responseBody = Blob.valueOf('Error: ' + e.getMessage());
}
}
}
i m getting Error on the 2 line
If it helps mark it as best answer.
Thanks!