CrmServiceClient.CloseActivity Method (String, Guid, String, String, Guid)


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

Closes the Activity type specified. The Activity Entity type supports fax , letter , and phonecall

*Note: This will default to using English names for Status. if you need to use Non-English, you should populate the names for completed for the status and state.

Namespace:   Microsoft.Xrm.Tooling.Connector
Assembly:  Microsoft.Xrm.Tooling.Connector (in Microsoft.Xrm.Tooling.Connector.dll)


public bool CloseActivity(
    string activityEntityType,
    Guid activityId,
    string stateCode = "completed",
    string statusCode = "completed",
    Guid batchId = null
Public Function CloseActivity (
    activityEntityType As String,
    activityId As Guid,
    stateCode As String,
    statusCode As String,
    batchId As Guid
) As Boolean


  • activityEntityType
    Type: System.String

    Type of Activity you would like to close.. Supports fax, letter, phonecall

  • activityId
    Type: System.Guid

    ID of the Activity you want to close

  • stateCode
    Type: System.String

    State Code configured on the activity

  • batchId
    Type: System.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

Return Value

Type: System.Boolean

true if success false if not.

See Also

CrmServiceClient Class
Microsoft.Xrm.Tooling.Connector Namespace

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright