SFDO-Community-Sprints / Interactions-for-Student-Recruitment

Open Source Community Sprint project focused on providing higher education institutions the tools they need to manage student recruitment in Salesforce.
BSD 3-Clause "New" or "Revised" License
51 stars 19 forks source link

Possible invalid status error on Lead conversion #13

Open kyleschmid opened 6 years ago

kyleschmid commented 6 years ago

The Interactions Processor uses a SOQL query to select any status where IsConverted = true to use as the Lead Status on conversion here: https://github.com/SalesforceFoundation/Interactions-for-Student-Recruitment/blob/master/src/classes/INT_InteractionProcessor.cls#L89. If Lead Record Types are enabled with a default Record Type assigned to a profile, it's possible that this query returns an invalid status value for the assigned Lead Process.

karamcintyre commented 6 years ago

In order to convert a Lead, it must be at a Lead Status that is marked as a "Converted" value. The code currently queries all Lead Status values and uses the first one that is marked as Converted. The work-around for this issue is to use only one Converted Status that is assigned to all Lead Record Types. If you need to use multiple Converted Statuses assigned to different Lead Record Types, significant code changes may be required.