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
Bhaskar@optraBhaskar@optra 

Its urgent...........!

HI All,

 

 

        I created one managed package with components as sitelogin page and sitelogin controller along with some custompages and controllers.After that I installed this package successfully in one test org..I am trying to login customer portal users, but it shows the page not found exception.Please help on this........

 

 

Any help greatly appreciated.........!:)

 

Thanks

Alok_NagarroAlok_Nagarro

Hi,

 

Probably you are missing package namespace prefix, if you hardcoded any page url in any page or in any class, then you must change url with namespace prefix . In source org (where you developeed this app) it will work fine, but when you create a package then a namespace prefix is included with every component of the package.

 

So first you need to check your controller classes that you are not sing hardcoded urls if so then have change it.

yarramyarram

Hi Alok,

I created one customer portal , four customer portal users and four profiles. These four profiles are assigned to that customer portal. And created one site on that site Active Site Home Page as Custom Login Page. i go and login with customer portal users login credintials its working fine.


But When i created managed package with these application,custom controllers,custom Vfpages and components,with SiteLogin Contoller and siteLogin page also.

 

And I Installed this package into another devloper account successfully.

 

Inthis New devloper account also i created one customerportal,four CP(customer Portal) users, Four profiles and created site the site active home page as Managedpackage Custom Login Page. When i tried to login with customer portal users creditials it gives the Error like ..............

 

Errors Like ......Insufficient Priviliges
PageNotFound

Any help greatly appreciated.

 

Thanks&Regards,

Yarram.

 

 

 

Alok_NagarroAlok_Nagarro

Hi,

 

As i mentioned in my last post that namespace name might be cause of this error. First make sure in SiteLoginController you didnt hardcode the value of retUrl parameter of login method ( like - retUrl='/apex/pagename'). If you did then you need to add prefix with pageName, for example - /apex/packagePrefix_pageName.

 

The best practise is try to refer pageName dynamically not hardcoded name.

yarramyarram

Hi Alok,

      I am not use "retUrl" in my siteLogin Controller. Plz check once my siteLogin Controller as Below 

 

 

//----SiteLogin Controller Code-------------------

global with sharing class SiteLoginController {


global String username {get; set;}
global String password {get; set;}
global String startURL = '/apex/SiteLogin';
global User pathUser;

private ID patientUserProfileId;

global PageReference login() {

pathUser= [select ProfileId from user where Username = :username];

if(pathUser.profileid==getUserProfileId('Patient User'))
{ Patient__c currentPatient = [select id, Name, PEmail__c from Patient__c where PEmail__c = :username];
startURL = '/apex/patient_home?id='+currentPatient.id;
return Site.login(username, password, startURL);
}

else if(pathUser.profileid==getUserProfileId('Pathologist User')){
Pathologist__c currentPathologist = [select id, Name, PEmail__c from Pathologist__c where PEmail__c = :username];
startURL = '/apex/pathologist_home?id='+currentPathologist.id ;
return Site.login(username, password, startURL);
}
else if(pathUser.profileid==getUserProfileId('AppAdmin User')){

startURL = '/apex/appadmin_home';
return Site.login(username, password, startURL);
}
startURL = '/apex/labadmin_home';
return Site.login(username, password, startURL);
}

private ID getUserProfileId(String profileName){
Profile userProfile = [Select id from Profile where Name=:profileName];
return userProfile.id;
}


global SiteLoginController () {}
}


//-----End--------------------------

 

This is Urgent issue.

 

Plz tell me where i did mistake in above Controller code.

 

Thanks & Regards

    Yarram

 

 

 

 

 

Alok_NagarroAlok_Nagarro

Hi,

 

In your class it is startURL, at every place in your controller you are giving a hardcode value to startURL.

In this case you have to add name space prefix with evry page name you are refering in the controller. For example let's take line no. 20 -

startURL = '/apex/patient_home?id='+currentPatient.id;

 

suppose that your namespace name is "mypackage" then this line must be like this -

 

startURL = '/apex/mypackage_patient_home?id='+currentPatient.id;

 

 

 

yarramyarram

Hi Alok,

 

We tried that one also, but our problem not resolved and after the implimentation of this thing  the source organisation site also not working so we need to find any other solution if you have then plz post it 

 

Thanks

Yarram