• Nilesh Badrakiya
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am getting a problem in site which i have customized...

i have customized a visualforce pages siteLogin and siteRegister.

 

when user click for new registration then it will redirect to the page siteRegister.

In site Register page if i submit a page it should redirect to siteLogin page.

 

but in my case it's redirecting to Authorization required page.why that is happening?

 

i also got a help from blog,it suggested 3 things

1) the page which i want to redirect ,it's not listed in site visual force pages.but in my case, list has.

2) by using debug logs, if any error in page.but i didn't find any error in my page.

3) enable a development mode and check an error.

 

i tried those things but it didn't help me.

Please any one help me.....

 

Regards,

Nilesh Badrakiya.

 

Hi All,

 

I am trying to get visitors of a site to self-register as members using the customer portal. This is something I have done a few times now, but in this case is not working.

 

The logic I during self registration is as follows:

 

- create a user, user

- create an account of type person account

- insert the account

- change the account owner to a system admin with a role assigned

- update the account

- get the accountId

- make the following call --> ID userId = Site.createPortalUser(u, accountId, password);

 

The above call return userId=null, so that the customer portal user is not created.

 

I have tried to do "manually"what  the Site.createPortalUser call does internally and it works. What I have done is as follows:

 

- create a user, user

- create an account of type person account

- insert the account

- change the account owner to a system admin with a role assigned

- update the account

- get the accountId

- get the PersonContactId (since this is a Person Account)

- assiign  user.ContactId = PersonContactId

- assing user.profileId = (Id of the customer portal user profile)

- insert user

 

This gets me a valid userId and the person account is created and enabled for the customer portal okay.

 

On that basis I have tried again the call to  Site.createPortalUser but instead of the accountId tried passing the PersonContactId (since it is a person account) and this did not work.

 

Any ideas would be very much appreciated.

 

Thanks in advance