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
Ritika JRitika J 

Overriding insufficient error message

hi,

 

I have a requirement in which if user click on the link in the related list and if user doesnt have permissions to view that record ,he will get an error message " insufficient Privelages ....".I want  instead of this message user should be taken to some other page where he can add that record to his territory.

 

 

Any idea how we can achieve this.

 

 

Thanks

RJoshi

Navatar_DbSupNavatar_DbSup

Hi,

You can use below code snippet to override the insufficient Privileges error message.

 

Try{}

Catch(Exception e)

{

 If(e.getmessage() == ‘Insufficient Error………’)

{

  Page Reference pr =  Page. RedirectPage;

pr.setRedirect(true);

return pr;

 }

}

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Ritika JRitika J

Hi ,

 

Thanks for your reply .

 

But this is a standard functionality so i should replace the related list with an inline vf page and there in extension class i can use this logic.

 

 

Navatar_DbSupNavatar_DbSup

Hi,

 

Yes you can embed the inline VF page and display your related list on that VF page and use the extension controller for your business logic 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.