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
Christos KolonisChristos Kolonis 

Visualforce page using jquery gives page error in Lightning Community

Hello,

I use a visualforce page which by clicking on a select list within that page, jquery fills in some information also in that page. The problem is when i'm logged in asa partner community user, when i click on the select list and the jquery runs i get a visualforce page error: Error occurred while loading a Visualforce page. A static resource (jquery) is used which is public. As an administrator it functions as it should. Any ideas of how to fix it?

Thank you.
Best Answer chosen by Christos Kolonis
Christos KolonisChristos Kolonis
The problem was that no access was given to certain objects needed when the fields refresh was taking place by the jquery. So, if any problems such as this occur, check the access to certain objects used.

All Answers

AbhishekAbhishek (Salesforce Developers) 
Chris,

Can you provide me the exact error message you are facing?

Thanks.
Christos KolonisChristos Kolonis
Of course. here is a screenshot:

User-added image
AbhishekAbhishek (Salesforce Developers) 
This is a problem within Salesforce and a standard Salesforce error message. It could be the Visualforce, the controller, extensions, or lookup issues done by code.
 
I would first recommend to debug your code, add try-catch blocks, and check your logs. I understand you probably don't want to modify your production code unless you really have to. But if your logs show you nothing you probably have to do something like this and ask your users having problems to reproduce their behaviors. 
 
Another tip to go by first is to open up the VF-page as an internal user. Doing this sometimes gives you more information than as a portal user. You access the VF-page as an internal user by removing everything in the URL before the apex page and replacing it with the standard URL you see as an internal user and 'apex'.

For example https://cs11.salesforce.com/apex/VFpage?anyparams&etc


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Christos KolonisChristos Kolonis
I will try to do so, but let me ask you something. This jquery basically fills in an email subject and body. Could this happen in case no access is given to the partner user? I couldn't find a way to provide such access.

Thank you.
AbhishekAbhishek (Salesforce Developers) 
I think so but I haven't tried that from my end, So I can't tell you confidently.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Christos KolonisChristos Kolonis
I tried to do the same thing as an internal user and i got another error:

FLS Exception --- SelectChecker, Object failed: Approval_Setting__c, field not Accessible: Status__c
Error is in expression '{!refreshPage}' in page myvisualforcepage

I checked the accessibility of the field and it is already granted? Any thoughts about it?
 
Christos KolonisChristos Kolonis
The problem was that no access was given to certain objects needed when the fields refresh was taking place by the jquery. So, if any problems such as this occur, check the access to certain objects used.
This was selected as the best answer