- An Opportunity is created from the originating Lead.
- You can select whether to create a Contact or Account from the originating Lead.
The code snippet below creates a new QualifyLeadRequest, populating all of it's required properties.
Replace all of my empty new EntityReference() objects with valid EntityReferences (which are instantiated by passing an entity name and an ID). Refer to the Microsoft documentation for information on other optional parameters which you can use.
The request is executed and its response stored in the qualifyLeadResponse:The most interesting property of the response object is CreatedEntities. See the Microsoft documentation for information on other properties stored in the QualifyLeadResponse.
CreatedEntities contains a collection of EntityReferences, one for each entity created when qualifying the Lead. To get the Contact that was created, for example, iterate through the collection and query the LogicalName of each EntityReference: