You need to sign in to do that
Don't have an account?
Chris987654321
Dynamic Updates
Is it possible to do dynamic SOQL statements do updates similar to how you do Select statements like this Database.query like Database.update
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Is it possible to do dynamic SOQL statements do updates similar to how you do Select statements like this Database.query like Database.update
Salesforce.com database follows an Object-Oriented pattern, so SQL-style insert/udpate statements are not available. However, you CAN dynamically update records in the following manner:
SObject cs = new Case();
cs.put('Subject', 'Mouse Error');
cs.put('Description', 'I cannot move my mouse pointer');
cs.put('Status', 'New');
cs.put('Field_Name1__c', 'Field Value 1');
cs.put('Field_Name2__c', 'Field Value 1');
cs.put('Field_Name3__c', 'Field Value 1');
update cs;
Check out the docs:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_dml.htm
Hope this helps!
-soof
All Answers
Salesforce.com database follows an Object-Oriented pattern, so SQL-style insert/udpate statements are not available. However, you CAN dynamically update records in the following manner:
SObject cs = new Case();
cs.put('Subject', 'Mouse Error');
cs.put('Description', 'I cannot move my mouse pointer');
cs.put('Status', 'New');
cs.put('Field_Name1__c', 'Field Value 1');
cs.put('Field_Name2__c', 'Field Value 1');
cs.put('Field_Name3__c', 'Field Value 1');
update cs;
Check out the docs:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_dml.htm
Hope this helps!
-soof