You need to sign in to do that
Don't have an account?
Sadish Kumar
Record Locking "For Update"
Hi Guys - I'm using a 'For Update' in my SOQL query in awebservice method and i'm getting an error message "Error: Compile Error: SObject type does not allow locking rows at line ". Can someone let me know whats the problem here !!!
My Code :
*****
global class recordLocking {
webService static Boolean lockmyrecord(String idUser) {
Boolean val = false;
User obj = null;
obj = [SELECT Id FROM User WHERE Id = :idUser LIMIT 1 FOR UPDATE];
return (val);
}
}
*****
My Code :
*****
global class recordLocking {
webService static Boolean lockmyrecord(String idUser) {
Boolean val = false;
User obj = null;
obj = [SELECT Id FROM User WHERE Id = :idUser LIMIT 1 FOR UPDATE];
return (val);
}
}
*****
User[] obj = [SELECT Id FROM User WHERE Id = :idUser LIMIT 1 FOR UPDATE];
use the First element when using the record.
.