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
Taylor YoungTaylor Young 

Why is the Name field on an sObject in Sandbox linking to Production?

I have a class that creates Tasks. When I go to the list view or the object page for those Tasks, if I click on Task Name field it links to Production (where the record doesn't exist) and asks me to login. 

I've never seen anything like this. Any ideas what is going on?

If you were wondering, no, I am not setting the Task Name field manually. It is automatically generated when the Task is created. 

Thank you!
ShirishaShirisha (Salesforce Developers) 
Hi Taylor,

Greetings!

Seems like the field is hardcoded or somewhere you have customized the field update with the URL.So,I would suggest you to enable the debug logs and try by clicking the Name field again to see,which code is being executed.

Then,please update the URL to sandbox url to avoid redirecting the product URL.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri