QualifyLeadRequest QualifyLeadRequest QualifyLeadRequest QualifyLeadRequest Class


Contains the data that is needed to qualify a lead and create account, contact, and opportunity records that are linked to the originating lead record.

For the Web API use the QualifyLead Action .

Web API support for this message was added with December 2016 update for Microsoft Dynamics 365 (online) and December 2016 Service Pack for Microsoft Dynamics 365 (on-premises) .

public ref class QualifyLeadRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
public sealed class QualifyLeadRequest : Microsoft.Xrm.Sdk.OrganizationRequest
type QualifyLeadRequest = class
    inherit OrganizationRequest
Public NotInheritable Class QualifyLeadRequest
Inherits OrganizationRequest


      // Qualify the first lead, creating an account and a contact from it, but
// not creating an opportunity.
var qualifyIntoAccountContactReq = new QualifyLeadRequest
    CreateAccount = true,
    CreateContact = true,
    LeadId = new EntityReference(Lead.EntityLogicalName, _lead1Id),
    Status = new OptionSetValue((int)lead_statuscode.Qualified)
    var qualifyIntoAccountContactRes = (QualifyLeadResponse)svc.Execute(qualifyIntoAccountContactReq);
Console.WriteLine("  The first lead was qualified.");

The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.



Message Availability

This message works regardless whether the caller is connected to the server or offline.


Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of the QualifyLeadResponse class.

Privileges and Access Rights

To perform this action, the caller must have privileges on the Lead, Account, Contact, Opportunity, TransactionCurrency, and Campaign entities. The caller must also have access rights on the specified records in the following properties: LeadId, OpportunityCurrencyId, OpportunityCustomerId, and SourceCampaignId. For a complete list of required privileges, see QualifyLead message privileges.

Notes for Callers

If SharePoint integration is enabled, the document location records for the lead are copied for the newly created account, contact, and opportunity.

If you set the CreateAccount property and the CreateContact property to true, the created account becomes a parent (Contact.Parentcustomerid) of the contact and the contact becomes a primary contact (Account.PrimaryContactId) for the account.


QualifyLeadRequest() QualifyLeadRequest() QualifyLeadRequest() QualifyLeadRequest()

Initializes a new instance of the QualifyLeadRequest class.


CreateAccount CreateAccount CreateAccount CreateAccount

Gets or sets a value that indicates whether to create an account from the originating lead. Required.

CreateContact CreateContact CreateContact CreateContact

Gets or sets a value that indicates whether to create a contact from the originating lead. Required.

CreateOpportunity CreateOpportunity CreateOpportunity CreateOpportunity

Gets or sets a value that indicates whether to create an opportunity from the originating lead. Required.

ExtensionData ExtensionData ExtensionData ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String] Item[String] Item[String] Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
LeadId LeadId LeadId LeadId

Gets or sets the ID of the lead that is qualified. Required.

OpportunityCurrencyId OpportunityCurrencyId OpportunityCurrencyId OpportunityCurrencyId

Gets or sets the currency to use for this opportunity. Required.

OpportunityCustomerId OpportunityCustomerId OpportunityCustomerId OpportunityCustomerId

Gets or set the account or contact that is associated with the opportunity. Required.

Parameters Parameters Parameters Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
ProcessInstanceId ProcessInstanceId ProcessInstanceId ProcessInstanceId

Gets or sets the ID of a business process flow instance running for the Lead record that should be set for the Opportunity record (created on qualifying the Lead record). Optional.

RequestId RequestId RequestId RequestId

Gets or sets the ID of an asynchronous operation (system job). Optional.

(Inherited from OrganizationRequest)
RequestName RequestName RequestName RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
SourceCampaignId SourceCampaignId SourceCampaignId SourceCampaignId

Gets or sets the source campaign that is associated with the opportunity. Required.

Status Status Status Status

Gets or sets the status of the lead. Required.

Applies to

See also