Creating a Task using CRM SDK 2011 - setting state and status? RRS feed

  • Question

  • Hello,

    I am trying to create a task using CMR SDK 2011 and I am getting the error "System.ServiceModle.FaultException 1[Micorsoft.Xrm.Sdk.Orginization.ServiceFault]: Required field 'Status' is missing (Fault Detail is equal to Micorsoft.Xrm.Sdk.Orginization.ServiceFault).

    Code used is below:

    'create the task first

               Dim tsk As New Task

               tsk.RegardingObjectId = acct.ToEntityReference

               tsk.Subject = "Support Package Email Sent " + Now.ToString

               tsk.Category = "Support Package Email"

               tsk.ActualDurationMinutes = 1

               tsk.ActualStart = Now

               tsk.Description = "Email notification sent"

               Dim tskid As Guid = _xrm.Create(tsk)

    Any suggestions are greatly appreciated!



    Tuesday, May 20, 2014 12:48 PM

All replies

  • Hi russel,

    Is there any plugin on Task Entity Create Message? 

    The code below works fine.By the way status field is optional, if you do not set any value for statuscode , crm will set its default value


    Task t = new Task();
     t.Subject = "yeppa";

    t.StatusCode = new OptionSetValue( (int) task_statuscode.Baslatilmadi);


    Friday, May 23, 2014 11:11 AM