Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Test Class erroring #2

Open
lauramccraven opened this issue Mar 19, 2019 · 4 comments
Open

Test Class erroring #2

lauramccraven opened this issue Mar 19, 2019 · 4 comments

Comments

@lauramccraven
Copy link

I am having a lot of issues with the test class. I've removed all of my build that was conflicting with the class but now I just get

System.DmlException: ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, There was an error converting the lead. Please try again. If the problem persists, please contact your administrator.: []

With no other information to troubleshoot on. Any ideas?

@chevans9
Copy link

I'm receiving the same error too. Did you end figuring out what the issue was?

@stargaterx
Copy link

Hey Doug,

Getting test error as well. ConvertLeadsInvocable working like a charm in sandbox but when I try to either deploy through change set or github, get same error:

System.DmlException: ConvertLead failed. First exception on row 0; first error: INVALID_FIELD, One or more leads couldn't be converted. If doNotCreateOpportunity is true, opportunityName and opportunityId must be null.: [Id]
Stack Trace: Class.ConvertLeadsInvocable.convertLeads: line 111, column 1 Class.ConvertLeadsInvocableTest.test_convert_lead_yes_opportunity: line 28, column 1

Any thoughts?

-Ron

@brandrsn
Copy link

brandrsn commented Dec 9, 2020

Hey @stargaterx,
I'm not @douglascayers, but I have just worked around a similar issue.
In my case, the Class expected my converted Lead status to be "Qualified", which is the default setting. Because my status was different, the deployment failed. When I reverted to "Qualified" temporarily, the deployment was successful.
So this make me think that Doug's code might expect default fields/values for the Lead object.
In your case, have you hard-coded an Opportunity Name somewhere? And/or set an Opportunity ID?
I guess my point is that I'd check any non-standard settings you have, and see if reverting them can get your deployment to succeed.
Good luck.

@johnBoomtown
Copy link

I'm getting the following error on the test class:

Methods defined as TestMethod do not support Web service calloutsStack Trace: null

Any help would be greatly appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants