+ Start a Discussion
Joanna Knott 6Joanna Knott 6 

Apex Trigger error when deleting account and sales order record

I am getting the following error when I try to delete an account. It prompts me to delete a sales order record, SO is a custom object. 

Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger Workforce2_CreateInventoryMessageForSales_Order_c caused an unexpected exception, contact your administrator: Workforce2_CreateInventoryMessageForSales_Order_c: execution of BeforeDelete caused by: TOA2.Workforce2_Exception: Mandatory mapping for field 'Activity Id' is not defined for class "Sales_Order__c".: (TOA2)".

I don't know how to fix it. Any suggestions or help would be greatly appreciated. Thanks in advance.