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
Project ManagersProject Managers 

{Case.Link} used in Email Templates returns page with error for some users

Hello,

We are using {!case.link} almost in all of our email templates (HTML).
When clicking on the link directly from the email, some users receiving the following error:

"List has no rows for assignment to SObject "

We tried to analyze this issue and this is our findings:
When I clicked on the email template I was able to get into the case without problem.
Other users, used the same email template, got the error above. I noticed that there were some changes between the Id's in the URL:
My Id included uppercase letters: '5006000000lQenhAAC' and AAC addition in the end, while the other URL contained only lowercase characters: '5006000000lqenhAAA' and AAA addition.

It is important to understand that this issue started just recently, we are using this templates for almost two years now. Our Case layouts are VF pages, but I already checked the permissions...

Could you please advise?

Udi
Best Answer chosen by Project Managers
Vivek_PatelVivek_Patel
Hello,

Best way to debug this is put the debug log using following steps

1) Nagivate to Setup -> Debug Logs
2) Click New
3) Select the user from which you are getting the error and then save.
4) Perform the operation on which you are getting the above error
5) Now refresh the debug logs page to see the debugs for that user
6) Inspect each logs to track down the error.

The error you mentioned is returned when there is no record returned by the SOQL query, so it could be that your class has "with sharing" and some of the users does have access to the record.


Regards,
Vivek Patel.

Please like or mark this as best answer if this answers your question to help others find better answer and improve the quality of developer forum.

All Answers

Vivek_PatelVivek_Patel
Hello,

Best way to debug this is put the debug log using following steps

1) Nagivate to Setup -> Debug Logs
2) Click New
3) Select the user from which you are getting the error and then save.
4) Perform the operation on which you are getting the above error
5) Now refresh the debug logs page to see the debugs for that user
6) Inspect each logs to track down the error.

The error you mentioned is returned when there is no record returned by the SOQL query, so it could be that your class has "with sharing" and some of the users does have access to the record.


Regards,
Vivek Patel.

Please like or mark this as best answer if this answers your question to help others find better answer and improve the quality of developer forum.
This was selected as the best answer
Project ManagersProject Managers
Hi Vivek,

I actually tried your suggested step at the begining... thanks.
We were able to find the root cause of this issue.
Apparently this is a browser issue that occur in Chrome.. we didn’t find exactly what is it, but at list we have workaround.

Any Ideas?

Thanks,

Udi
Vivek_PatelVivek_Patel
Hi,

It is hard to tell what's happening in the browser until I see that error and SF logs.

One thing you can try is clearing out the cache of the chrome if is happening on a specific machine and browser.

Regards,
Vivek Patel.