Jagamisviis:


QualifyLeadRequest Class

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

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) .

Namespace:   Microsoft.Crm.Sdk.Messages
Assembly:  Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

Inheritance Hierarchy

System.Object
  Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Crm.Sdk.Messages.QualifyLeadRequest

Syntax

[DataContractAttribute(Namespace = "https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class QualifyLeadRequest : OrganizationRequest
<DataContractAttribute(Namespace := "https://schemas.microsoft.com/crm/2011/Contracts")>
Public NotInheritable Class QualifyLeadRequest
    Inherits OrganizationRequest

Constructors

Name Description
System_CAPS_pubmethod QualifyLeadRequest()

Initializes a new instance of the QualifyLeadRequest class.

Properties

Name Description
System_CAPS_pubproperty CreateAccount

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

System_CAPS_pubproperty CreateContact

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

System_CAPS_pubproperty CreateOpportunity

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

System_CAPS_pubproperty ExtensionData

Gets or sets the structure that contains extra data. Optional.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty Item[String]

Gets or sets the indexer for the Parameters collection.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty LeadId

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

System_CAPS_pubproperty OpportunityCurrencyId

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

System_CAPS_pubproperty OpportunityCustomerId

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

System_CAPS_pubproperty Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty 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.

System_CAPS_pubproperty RequestId

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

System_CAPS_pubproperty RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty SourceCampaignId

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

System_CAPS_pubproperty Status

Gets or sets the status of the lead. Required.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Remarks

Message Availability

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

Usage

Pass an instance of this class to theExecute 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.

Examples

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.


// 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)_serviceProxy.Execute(qualifyIntoAccountContactReq);
Console.WriteLine("  The first lead was qualified.");

Thread Safety

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

QualifyLeadResponse
Microsoft.Crm.Sdk.Messages Namespace
Sales entities (lead, opportunity, competitor, quote, order, invoice)
Sample: Qualify a lead
Customer entities (account, contact)
Transaction Currency (currency) entity
Campaign entities
How role-based security can be used to control access to entities in Microsoft Dynamics 365
How record-based security can be used to control access to records in Microsoft Dynamics 365
QualifyLead message privileges

Return to top

Microsoft Dynamics 365

© 2017 Microsoft. All rights reserved. Copyright