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

Finding line number to go with error message

I got a "List has no rows for assignment to SObject An unexpected error has occurred. Your development organization has been notified." error message. I know what this error message generally means, but I don't know what the offending line(s) are. It's happening in my production environment, but not in my Sandbox, and I think it has something to do with some fields being populated in the Sandbox, but they're not in the Production so a query is failing somewhere.


Is there a way to determine what lines of what class are causing the problem (line numbers)?




yes you can.. take the debug log and search for "list has no rows" then you can identify the line or the place where exactly you are using the list which has no values.....the system admin of the org must get the error statement as a  mail so you can get the debug from him/her or you have to login in to prod and put a debug am execute the same action for a test record. 


Got it, thanks, I just needed to add a new user to the list of Monitored Users, hadn't done it in a while and forgot about it on this server.