You need to sign in to do that
Don't have an account?
cooltub
Add customer portal users to different accounts based on parameter
Hi
Is it possible to add Customer portal users to self register themselves and add as contacts of the account id passed as parameter.
I know that we can hardcode Account ID in SiteRegisterController Apexclass to assign all the self register contacts to that account, but is it possible to add them dynamically to different accounts passed as parameter?
Yes we can do that .Just Query the Account which You want to associate as customer portal user and Pass the id of that Account As a argument in Site.createPortalUser .But Make sure the Owner of the Account Must have a role .
All Answers
Yes we can do that .Just Query the Account which You want to associate as customer portal user and Pass the id of that Account As a argument in Site.createPortalUser .But Make sure the Owner of the Account Must have a role .
Hi Pan_AK,
Thanks for replying. I'm a newbie here, Can you explain in detail please?
Hi,
If you are creating a customer portal user through sites using -
site.createportaluser(u, accoundid, optional, optional(included in winter'12))
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hi Ispita,
I have added the following lines to SiteRegisterController Apexclass. I'm trying pass account id as parameter and assign it to PORTAL_ACCOUNT_ID. But when i try to self register contacts are added to that account.
public static Id accid;
public SiteRegisterController () {
accid = ApexPages.currentPage().getParameters().get('Id');}
private static Id PORTAL_ACCOUNT_ID = accid;
Thanks Pan_AK and Ispita that worked!
Can you please look into this post as well?
http://boards.developerforce.com/t5/Visualforce-Development/Form-with-master-detail-lookup-field-automatically-populated/td-p/358091