Skip to main content

Hi Team,

 

We started to get this error message all of a sudden in our production environment and it is not clear to me what has changed.  We use custom apex classes and Lightning components for task creation in Lightning, since not all of the features were available in Lightning and we started to see this message all of a sudden on Friday afternoon around 3pm.  There have been no releases and the patch is the same as our sandbox where I cannot reproduce the issue.  When looking at the log we realized it's related to sending the email notification when the task is created:

 

17:03:58.131 (1412998715)|SYSTEM_METHOD_ENTRY|[584]|System.debug(ANY)

17:03:58.131 (1413011018)|USER_DEBUG|[584]|DEBUG|123qwe =STACK=Class.NewTaskContr.sendEmail: line 603, column 1

Class.NewTaskContr.saveObject: line 580, column 1-123qwe-MESSAGE=List has no rows for assignment to SObject

17:03:58.131 (1413020053)|SYSTEM_METHOD_EXIT|[584]|System.debug(ANY)

17:03:58.131 (1413024976)|STATEMENT_EXECUTE|[585]

 

Our users have a workaround to use Classic and that works fine for them but was wondering if anyone has any tips on this one or has run into similar issues.

 

Simina

5 Antworten
  1. 10. Jan. 2022, 19:10

    Hello,

     

    Thank you to those who assisted with this query.  One of my colleagues realized the following query was returning no results in Salesforce PROD:

     

    SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Notification_to_Task_Owner_On_Save'

     

    The issue was caused by a new email templates folder into which all of the templates from the unfiled public templates folder were accidentally moved.  Because the new folder was only available to system administrators, the error message was being thrown to regular users of the system.  It also explained why system administrators could not reproduce the issue in PROD and could not reproduce the issue as the user in the sandbox (since the new folder was not created there!).  Once the email templates were moved back to the original folder, the issue was no longer occurring.  

     

    Simina