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
Amar BanerjeeAmar Banerjee 

Site.createPersonAccountPortalUser() & Site.Login returns Null sometimes & works sometimes

HI,

I am useing customized functionality for community users.

Secnarion:  We have a a mobile microsite UI which uses AngularJS as an intermidiatory body between Salesforce & Mobile microsite(website scalable to mobile screen). Mobile  microsite calls Angular JS controller which in turn calls SFDC remote call to salesforce controller.
Keeping in mind that Mobile microsite UI is nothing but HTML5 code in a VF Page & we have person account enabled in our environment.
In salesforce remote action methods, I am using Site.createPersonAccountPortalUser() & Site.Login(username,password,null) methods.

Issue: The issue is that we get some times correct response from site methods & some times we get null. some time Site.createPersonAccountPortalUser()
returns userID & some times it returns 'Null'. same is with Site.Login() method. some times login method returns page reference & some times it returns 'NULL'.
           The project we are working is in very crucial stage.. any suggesitons/ Pointers can help to solve the issue....

Regards,
Amar 
 
Avidev9Avidev9
I have seen the login method react this way when the user is trying to login using a "http:" url instead of "https" . is that is the case for you ?
Amar Banerjee 8Amar Banerjee 8
HI Avi,
Thanks for response.
Thats not the case for us. We are always forcing the VF page to open on [Https]. eventhough customer opens on http,
its forcefully opened on HTTPS. 
    We are still getting NULL as response from "Site.createPersonAccountPortalUser()" while selfregistration for some customers. if anyone havs any solution of it kidly post it to me.

regards,
Amar