- 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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qualifyLeadResponse = (QualifyLeadResponse)service.Execute(qualifyLeadRequest); |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var entity in qualifyLeadResponse.CreatedEntities) | |
{ | |
if (entity.LogicalName == "contact") | |
{ | |
// TODO. | |
} | |
} |
Great Artical..!
ReplyDeleteHow to Qualify a Lead - Qualifying a business lead online requires a lot of skill and finesse. In this blog, we reveal a few tricks of the trade to procure the right kind of lead for your to boost your business.
How to Qualify a Lead
Need help on this...
ReplyDeleteI am setting all booleans values to true. I want to create all three records.
But the parameter "OpportunityCustomerId" is required. Since I am creating the account and contact on qualify itself, how could i give the entityreference to that?