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
sjain1.2523113033806995E12sjain1.2523113033806995E12 

Test method Coverage for site.createPortalUser method for Registration

Hi,

      i want to know how to cover the site.createportaluser() method in testmethods. when i run the class which creates customer portal user through this methods.when run the class this method always returns null. Any help would be great appreciable.

string Userid = site.createportaluser(u,accountid,null);

Ryan-GuestRyan-Guest

Yup, it always returns null in a test. You can look at the sample SelfRegistration class in your org for an example of how to test this.