How can I update 'IsSsoEnabled' field on Profile to true for some specific profiles in schedule class which runs every hour? When I am trying to update it through apex code, it is giving the error "DML not allowed on Profile"


You won't be able to do DML on profile object.It's read only.

You can update for different profiles via force.com IDE by editing metadata xml and setting this to true and saving the metadata xml.

Since you need this to be scheduled ,you can explore metadata API to achieve this either through a java program or use metadata apex wrapper from financial force to do this via apex

  • 2
    If they wish to update via scheduled job, they could make use of the Metadata API. Build a scheduled class to call the metadata API and update the profile that way. I've never done this myself, but sounds plausible to me. – zainogj Jan 8 '16 at 13:51
  • Yes a java program needs to be written to do this via metadata API .if needed in apex use financial force apex metadata wrapper – Mohith Shrivastava Jan 8 '16 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.