You need to sign in to do that
Don't have an account?
Selina Suarez
Error when tying to deploy a change set
Apex Test Failures
Class Name: MassConvertLead
Method Name: MassConvertLead testMassConvertLead System.QueryException:
Error Message: List has no rows for assignment to SObject
Stack Trace: Class.MassConvertLead.testMassConvertLead: line 55, column 1
I recently changed a record type name and line 55 is pointing to something referencing the record type name as follows:
Id recordTypeId = [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'National Admissions Application'].Id;
I cannot get this to work at all. Can anyone offer any help?
Thanks!
Class Name: MassConvertLead
Method Name: MassConvertLead testMassConvertLead System.QueryException:
Error Message: List has no rows for assignment to SObject
Stack Trace: Class.MassConvertLead.testMassConvertLead: line 55, column 1
I recently changed a record type name and line 55 is pointing to something referencing the record type name as follows:
Id recordTypeId = [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'National Admissions Application'].Id;
I cannot get this to work at all. Can anyone offer any help?
Thanks!
Existing code was - [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'A']
Now you need to change this to [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'B']
This will fix the issue for the time being.
But please note that there ae other ways to make the independent of the changes made to name of the record type and that is by using another field called DeveloperName.
You query should be something like this -
[Select Id From RecordType Where SObjectType = 'Lead' And DeveloperName = 'Appropriate Developer Name']
You can find the developer name from the record type page or by doing a simple query to the record type object.
Please let me know if you have further doubts.
Thanks,
Kaustav
All Answers
Use the scema explorer in eclipse to have a look at the field and its values.
Thanks,
Kaustav
Existing code was - [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'A']
Now you need to change this to [Select Id From RecordType Where SObjectType = 'Lead' And Name = 'B']
This will fix the issue for the time being.
But please note that there ae other ways to make the independent of the changes made to name of the record type and that is by using another field called DeveloperName.
You query should be something like this -
[Select Id From RecordType Where SObjectType = 'Lead' And DeveloperName = 'Appropriate Developer Name']
You can find the developer name from the record type page or by doing a simple query to the record type object.
Please let me know if you have further doubts.
Thanks,
Kaustav
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.MassConvertLead.testMassConvertLead: line 55, column 1
any thoughts?