function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amol ChAmol Ch 

Javascript custom button throws error for non admin user

I've written simple code to update field on object by using javascript custom button, The field is read only from Page Layout. When i try for System Admin it works, but when i try for non-admin user it throwing Error. The code is ;

 var o = new sforce.SObject("Student__c"); = "{!Student__c.Id}";
 o.Laptop__c = true; 
 result =sforce.connection.update([o]);

 if (result[0].getBoolean("success")) {
 alert("record with id " + result[0].id + " updated");
 } else {
 alert("failed to update " + result[0]);
it throws me error as;
failed to update {errors:{fields:'Id', message:'Record ID: id value of incorrect type: fgggggggggg', statusCode:'MALFORMED_ID', }, id:null, success:'false', }
Even if i've removed read only form page layout still its throwing why? please suggest.