You need to sign in to do that
Don't have an account?
![Haya Haya](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
How do we promote a guest user to become a portal user
We would like our customer portal users to be able to update their own profile.
Our MyProfilePageController says : Guest users are never able to access this page.
How do I give the portal users permission to update their profile? (We don’t want the self-registration option available to them.)
Thank you,
Haya
Our MyProfilePageController says : Guest users are never able to access this page.
How do I give the portal users permission to update their profile? (We don’t want the self-registration option available to them.)
Thank you,
Haya
Go to: sites -> click on site name -> Login Settings -> edit -> enter “MyProfilePage” for My Profile Page
All Answers
It is not possible. As per design we can not grant access to Guest users to update their own profile.
Can they be promoted?
Portal users are not Guest users. Portal users have different type of licenses (customer community, portal community, high volume customer portal user license) . Please refer following help doc for better undertanding on Guest users:
http://help.salesforce.com/apex/HTViewSolution?id=000006778&language=en_US
Thank you, that was very helpful.
The users on our portal are high volume customer portal users, so my problem is not that our MyProfilePageController says : Guest users are never able to access this page.
I need to go back to and study the code.
I went to a few places to make sure the high volume customer portal users have access to MyProfilePage:
In Pages -> Security -> Enabled Profiles
in Apex -> Security (MyProfilePageController) -> Enabled Profiles
I searched in user's profiles for a UserType but can't find it, the following code tests for it.
Please help me figure it out.
Can i create a group for all the portal users and test for that value?
this following code is in MyProfilePageController. Where do i find the UserType? I searched in user's proifiles
@IsTest(SeeAllData=true) static void testSave() {
// Modify the test to query for a portal user that exists in your org
List<User> existingPortalUsers = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess'];
if (existingPortalUsers.isEmpty()) {
User currentUser = [select id, title, firstname, lastname, email, phone, mobilephone, fax, street, city, state, postalcode, country
FROM User WHERE id =: UserInfo.getUserId()];
MyProfilePageController controller = new MyProfilePageController();
System.assertEquals(currentUser.Id, controller.getUser().Id, 'Did not successfully load the current user');
System.assert(controller.isEdit == false, 'isEdit should default to false');
controller.edit();
System.assert(controller.isEdit == true);
controller.cancel();
System.assert(controller.isEdit == false);
Contact c = new Contact();
c.LastName = 'TestContact';
insert c;
setContactFields(c, currentUser);
controller.save();
System.assert(Page.ChangePassword.getUrl().equals(controller.changePassword().getUrl()));
} else {
User existingPortalUser = existingPortalUsers[0];
String randFax = Math.rint(Math.random() * 1000) + '5551234';
System.runAs(existingPortalUser) {
MyProfilePageController controller = new MyProfilePageController();
System.assertEquals(existingPortalUser.Id, controller.getUser().Id, 'Did not successfully load the current user');
System.assert(controller.isEdit == false, 'isEdit should default to false');
controller.edit();
System.assert(controller.isEdit == true);
controller.cancel();
System.assert(controller.isEdit == false);
controller.getUser().Fax = randFax;
controller.save();
System.assert(controller.isEdit == false);
}
When I try to edit or just save MyProfilePageController I get:
Error: MyProfilePageController Compile Error: Test methods must be in test classes at line 76 column 42
That line is: @IsTest(SeeAllData=true) static void testSave() {
From what i gather both MyProfilePage and MyProfilePageController were generated by SF.
It says: // Modify the test to query for a portal user that exists in your org,
so I need to test for the cusotmer portal but I don't know how.
I need help making it work.
Thanks in advance,
Haya
Go to: sites -> click on site name -> Login Settings -> edit -> enter “MyProfilePage” for My Profile Page