Sometimes we are very close to cross governer limit in soql and we want to Update Salesforce Object Fields.
If you have object id available you can easily get object fields without using soql and perform any dml on it
here is the code for the getting object fields using object id :
here var is the variable in which object id is stored.
// creating a new instance of object
SIS_Student__c stu = new SIS_Student__c();
// assigning id to new instance
stu.Id = var;
stu.First_Name__c = firstname;
stu.Onboarding_Complete__c = True;
// performing dml operation on object
update stu;
Hits: 548