2

I've already googled on this issues and I did all the recommendations, But still Un achieved,

I've created visualforce page to display Attachments on Particular Object for Current Logged in User in Portals,

It is working fine by passsing HardCoded Id over URL (Poratal user) and also By Opening that Page Seperately(apex/MyInvoiceDocs?Id='abd145455562') Its working.

Outside portal Home page, By Hardcoding the One of Portal User Id

But when I access this page in Portals(Using "where ID=:UserInfo.getUserId()" in controller Query )

Which actually gets Id of current logged in User(Portal enabled) and Displays Attachments

I'm getting " Error occurred while loading a Visualforce page "

Also, This page and Class is already Accessible to that User's Profile(Apex class and VF page access)

Any one Suggest me...

And I didnt used any Lookup field on VF page and I used,

 <apex:column headerValue="View / Download">
            <apex:outputLink styleClass="btn" value="{!URLFOR($Action.Attachment.Download, a.At.Id)}" target="_blank"> View </apex:outputLink> 
       </apex:column> 

for Download / view of attachment

  • If you have any lookup field on Visualforce page make sure provide access to lookup object from profile. – MIX DML Aug 1 '15 at 12:50
  • @Prabhat Hi Prabhat, I've used a wraper class list to display the Attachment name and Object Name to which Attachment belogs and other field. – SFDC_Igle Aug 1 '15 at 13:02
  • @Prabhat I've updated my quation have a look on It, and I think using global variable like $Action on VF pages that are used for Portal Usrs is Not Prefered.. please suggest me other i will share my class and controller if u need to identify bugs – SFDC_Igle Aug 1 '15 at 13:12
  • @SFDC_Igle you can try one thing. In standard exception Page you will find one line <apex:param value="{!error.messages}" /> change this to <apex:param value="{!error.description}" />. it will surely help you. try this and reload your page. – Tushar Sharma Aug 1 '15 at 13:17
  • @SFDC_lgle How you are loading visualforce page if its through Javascript button then URL could be issue. – MIX DML Aug 1 '15 at 13:19
3

@SFDC_Igle you can try one thing. In standard exception Page you will find one line as shown below

<apex:param value="{!error.messages}" />

which you should change to

<apex:param value="{!error.description}" />.

Try this and reload your page.

| improve this answer | |
  • Nice one, I didn't know this trick :) – PepeFloyd Aug 3 '15 at 19:58
1

Is the object accessible to the user?. Verify also that the required fields such as name are available to the user's profile.

Permissions on the object, fields, classes or VF pages are the most common causes for this type of errors.

| improve this answer | |
  • Thank you for the reply, And i have given access at Profile for all fields and Objects , which are used in my class and For the Attachments object I didnt see any Object and Field settings in Profiles. Still I am Getting the Same Issue, Tell me any other work around Please.. – SFDC_Igle Aug 1 '15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.