You need to sign in to do that
Don't have an account?
Craig Rosenbaum
update() on Organization Object
According to the API guide, I should be able to update the Organization object.
When I try to update it via annonymous apex, I receive this error: "DML not allowed on Organization". Here's my code:
Our use case is to allow users to edit their Organization's address through a custom visualforce page made in Skuid. When we were unable to edit this object in Skuid, I tried it in apex to confirm and received the same result. Is there a way to update the Organization information outside of the standard SF page? The documentation suggests so but I have not been successful with it.
When I try to update it via annonymous apex, I receive this error: "DML not allowed on Organization". Here's my code:
Organization o = [Select Name from Organization]; o.City = 'Dallas'; update o;This was executed by the system admin on the account with "View All Data" enabled.
Our use case is to allow users to edit their Organization's address through a custom visualforce page made in Skuid. When we were unable to edit this object in Skuid, I tried it in apex to confirm and received the same result. Is there a way to update the Organization information outside of the standard SF page? The documentation suggests so but I have not been successful with it.
This is one of those cases where the functionality is only available through the API. So you will have to implement the update() method of the SOAP or REST api to update the Organization. This will not work using Apex and DML.
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
All Answers
This is one of those cases where the functionality is only available through the API. So you will have to implement the update() method of the SOAP or REST api to update the Organization. This will not work using Apex and DML.
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.