You need to sign in to do that
Don't have an account?
haroona
Bulk Update Using Where clause
Hi,
Can I do something like this in APEX:
update leads set company='MyCompany' where fname="myself";
This would update mutiple records with the one line command.
This of course is standard SQL syntax. Wondering if this is possible on the Force.com platform.
Regards
-Haroon
Hi
Unfortunately SOQL only supports SELECT syntax. See this page:
http://www.salesforce.com/us/developer/docs/api90/Content/sforce_api_calls_soql.htm
What you have to do is query for the rows you want to update, then update the records and save, like so:
Not quite as convenient as standard SQL, but it works.
Let me know if you need any help with anything, it's what we do ;)
Gabriel Alack
Contact Us - We Can Help!
Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x122
All Answers
Hi
Unfortunately SOQL only supports SELECT syntax. See this page:
http://www.salesforce.com/us/developer/docs/api90/Content/sforce_api_calls_soql.htm
What you have to do is query for the rows you want to update, then update the records and save, like so:
Not quite as convenient as standard SQL, but it works.
Let me know if you need any help with anything, it's what we do ;)
Gabriel Alack
Contact Us - We Can Help!
Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x122
Thanks, Gabriel!