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
vmarcovmarco 

Partner WSC create user doesn't work

I am using the partner WSC-22 library to create a SF user on my DE account from a service.  Everything runs smoothly (ie. no exceptions), however the user does not show up in my user management list of users.  No error, no results.  Any suggestions?  Code is in Scala.  I have had exceptions when improperly submitting fields, so I know it is reaching SF.

 

doLogin()
val sobj = new SObject
sobj.setType("User")
sobj.setField("LastName", users(0))
sobj.setField("Alias", users(0))
sobj.setField("Email", email)
sobj.setField("Username", users(0))
val result = _connection.create(Array(sobj))

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

You are not checking the result, that'll tell you why it didn't create the user.

All Answers

SuperfellSuperfell

You are not checking the result, that'll tell you why it didn't create the user.

This was selected as the best answer
vmarcovmarco

Thank you, that did point me in the right direction.  I got lulled into thinking I would get exceptions on errors by the invalid field exceptions SF threw earlier in my integration efforts.  But I should be checking results.

 

Is there any way to delete users on a DE account?  I read that you can only deactivate users rather than delete them, but on a DE account it seems that severely limits the testability of the create user process.  For example, I'm building out an SSO function that aids in onboarding new employees and have a set of test users.  It seems like I'll need a new set of users for each test run.

 

Thanks,

 

Vince