Problem
After a user registers for an event, they might see part of the following error either on the front-end or in Salesforce error logs.
sbxe1.sbx_EventsCampaignMember: execution of AfterInsert
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.sbxe1.sbx_EventsCampaignMember
...or...
sbxe1.sbx_EventsLead: execution of AfterUpdate
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.sbxe1.sbx_EventsLead
...or...
“sbxe1.sbx_EventsOpportunity: execution of BeforeInsert
caused by: System.QueryException: List has no rows for assignment to SObject (sbxe1)”
Potential Solution
This issue tends to be related to missing record types on the Opportunity and Lead objects. As a starting point, ensure that the following record types are included.
- Opportunity object: Soapbox Registration Order
- Lead object: Soapbox Registration Order
If either of these record types are missing from your Salesforce org, you'll want to create them manually following the steps.
IMPORTANT NOTE: These are different and separate record types from the "Soapbox Registration" record types on the Lead and Opportunity objects.
- Lead Record Type
-
Go to Setup > Object Manager> Leads > Record Types
-
Click the New button to create a new record type
-
For Existing Record Type, leave it selected for “--Master--”
-
For Record Type Label, enter “Soapbox Registration Order”.
- For Sales Process = “Soapbox Events Registrations"
-
For Record Type Name, enter “sbx_Registration_Order_Lead”.
-
For Lead Process, choose “Default” or whatever the name of your default lead process might be.
-
For Description, enter “Soapbox Events registration order Lead record type.”
-
For Active, check the checkbox.
-
At the bottom of the screen, choose which profiles should have access to this Default record type. Most times, you can likely check all of the Enable for Profile boxes, but if you need to limit it, at least enable it for the System Administrator. Additionally, if you’d like to continue to make this the default record type chosen for the object when using Salesforce, check the appropriate Make Default boxes.
-
Click the Next button.
-
Select the “Apply one layout to all profiles” option, and in the dropdown to the right of it, choose the “Lead Layout”. This will make this make the new Default record type’s default layout the original Lead Layout. You can also customize this as you wish.
-
Click the Save button.
-
-
- Opportunity Record Type
-
Go to Setup > Object Manager> Opportunities > Record Types
-
Click the New button to create a new record type
-
For Existing Record Type, leave it selected for “--Master--”
-
For Record Type Label, enter “Soapbox Registration Order”.
- For Sales Process = “Soapbox Events Registrations"
-
For Record Type Name, enter “sbx_Registration_Order_Opportunity”.
-
For Opportunity Process, choose “Default” or whatever the name of your default sales process might be.
-
For Description, enter “Soapbox Events registration order Opportunity record type.”
-
For Active, check the checkbox.
-
At the bottom of the screen, choose which profiles should have access to this Default record type. Most times, you can likely check all of the Enable for Profile boxes, but if you need to limit it, at least enable it for the System Administrator. Additionally, if you’d like to continue to make this the default record type chosen for the object when using Salesforce, check the appropriate Make Default boxes.
-
Click the Next button.
-
Select the “Apply one layout to all profiles” option, and in the dropdown to the right of it, choose the “Opportunity Layout”. This will make this make the new Default record type’s default layout the original Opportunity Layout. You can also customize this as you wish.
-
Click the Save button.
-
-