creating letter activity RRS feed

  • Question

  • Hello guys,

    How do i create a new letter activity?

    I am doing it this way right now(part of code):

      activitypointer act = new activitypointer();

                EntityNameReference en = new EntityNameReference();
                en.Value = "4207";
                act.activitytypecode = en;

                ActivityPointerStateInfo ac = new ActivityPointerStateInfo();
                ac.Value = ActivityPointerState.Open;
                act.statecode = ac;

                Lookup lk = new Lookup();
                lk.type = EntityName.contact.ToString();
                lk.Value = new Guid("{CC54FE23-480D-E011-A305-00155D04AD60}");
                act.modifiedby = lk;

                txtreply.Text = act.modifiedby.Value.ToString();
                Owner ow = new Owner();
                ow.Value = lk.Value;
                ow.type = EntityName.contact.ToString();
                act.ownerid = ow;
                act.subject = txtsubject.Text;

                act.description = txtreply.Text;




                Guid actguid = Guid.Empty;
                actguid = service.Create(act);



    Is this the right way to do it. If i am doing it this way. i am getting a hard error because i am not inserting the value 'expansionstatecode' along with the activitypointer 'act'. but to assign a value to expansionstatecode i am not able to access it this way(act.expansionstatecode throws an error as well)


    I am so confused, there is also a class called Letter() in crmsdk. Do i need to create a object for Letter class and create a letter activity?


    I am sorry i am a complete newbie and need some help/guidance.





    Monday, January 17, 2011 4:55 PM


  • Look into the 'Letter' entity.  Create a letter object, populate all required attributes and any others that your solution requires, and use the CrmService.Create method as you've already done to create the letter entity instance.

    --pogo (pat)
    Tuesday, January 18, 2011 12:20 AM