function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robert LawRobert Law 

SSO Create User and Contact

When I try to create a user and contact in my SSO Response, I get a DML error stating that I can't have  setup and non-setup object updates in the same DML.  How do I provision a User and Contact in my SSO Response?
Carolina Ruiz MedinaCarolina Ruiz Medina
Hi Robert, 
Could you please share your code? (or the part that is failing please? ) I'm guessing you are creating your own Registration Handler and it implmen ts Auth.RegistrationHandler ? When do you get the error on createUser method? on updateUser method? or in your Unit tests? 

Meanwhile I would like  to add here some links that could help you a little bit more too:
http://salesforce.stackexchange.com/questions/13318/error-mixed-dml-operation-on-setup-and-non-setup-objects
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008wAZIAY
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AgGDIA0
http://stackoverflow.com/questions/2387475/how-to-avoid-mixed-dml-operation-error-in-salesforce-tests-that-create-users

Hope it helps. 

Thanks ,
Carolina.