Skip to main content
added 48 characters in body
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

I had this same issue. What I did is add one more code to render the user id again.

User u = new User(); u.lastname= 'blabla'; u.ContactId = currentContact.Id; u.email='[email protected]'; ... ... ... system.setPassword(u.Id, 'password123');

User uu =[select id from user where email='[email protected]'];

return uu.id;

User u = new User();
u.lastname= 'blabla';
u.ContactId = currentContact.Id;
u.email='[email protected]';
...
...
...
system.setPassword(u.Id, 'password123');

User uu =[select id from user where email='[email protected]'];

return uu.id;

I had this same issue. What I did is add one more code to render the user id again.

User u = new User(); u.lastname= 'blabla'; u.ContactId = currentContact.Id; u.email='[email protected]'; ... ... ... system.setPassword(u.Id, 'password123');

User uu =[select id from user where email='[email protected]'];

return uu.id;

I had this same issue. What I did is add one more code to render the user id again.

User u = new User();
u.lastname= 'blabla';
u.ContactId = currentContact.Id;
u.email='[email protected]';
...
...
...
system.setPassword(u.Id, 'password123');

User uu =[select id from user where email='[email protected]'];

return uu.id;
Source Link

I had this same issue. What I did is add one more code to render the user id again.

User u = new User(); u.lastname= 'blabla'; u.ContactId = currentContact.Id; u.email='[email protected]'; ... ... ... system.setPassword(u.Id, 'password123');

User uu =[select id from user where email='[email protected]'];

return uu.id;