Udostępnij za pośrednictwem


CrmServiceClient.CloseOpportunity Method

Definition

This will close an opportunity as either Won or lost in CRM

public Guid CloseOpportunity (Guid opportunityId, System.Collections.Generic.Dictionary<string,Microsoft.Xrm.Tooling.Connector.CrmDataTypeWrapper> fieldList, int opportunityStatusCode = 3, Guid batchId = default);
member this.CloseOpportunity : Guid * System.Collections.Generic.Dictionary<string, Microsoft.Xrm.Tooling.Connector.CrmDataTypeWrapper> * int * Guid -> Guid
Public Function CloseOpportunity (opportunityId As Guid, fieldList As Dictionary(Of String, CrmDataTypeWrapper), Optional opportunityStatusCode As Integer = 3, Optional batchId As Guid = Nothing) As Guid

Parameters

opportunityId
Guid

ID of the opportunity to close

fieldList
Dictionary<String,CrmDataTypeWrapper>

List of fields for the Opportunity Close Entity

opportunityStatusCode
Int32

Status code of Opportunity, Should be either 1 or 2, defaults to 1 ( won )

batchId
Guid

Optional: if set to a valid GUID, generated by the Create Batch Request Method, will assigned the request to the batch for later execution, on fail, runs the request immediately

Returns

Applies to