locked
Plugin for custom entity RRS feed

Answers

  • Hi, Glora.

    This is was the sample for any count of lines. And it is not necessary to use targetCreate to create entity.

    DynamicEntity entity = new DynamicEntity("Your entity name");
    entity["your string property name"] = "String property value";
    entity["your 2 string property name"] = "String 2 property value";
    entity["your 3 string property name"] = "String 3 property value";
    ...

    Guid entityid = crmservice.Create(entity);

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, July 22, 2009 7:25 PM
    Moderator

All replies

  • Hi, Glora.

    The easiest way for work with DynamicEntitie class:

    DynamicEntity entity = new DynamicEntity("Your entity name");
    entity["your string property name"] = "String property value";

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, July 22, 2009 6:11 PM
    Moderator
  • Hi Glora,

    There is no need to go through the hassel of writing any code if I have understood your requirement. Go through msdn, you will find a plugin to download which performs similar functions.

    Go to the following link:-

    http://code.msdn.microsoft.com/auditing4crm

    Regards
    Prince
    Wednesday, July 22, 2009 6:24 PM
  • Hi Prince, Not sure if that answers my question. I just need to know how to create/update a record for a custom entity without type-cast errors.

    Hi Andriy, Do I have to write those two lines of code (DynamicEntity entity = new DynamicEntity("Your entity name");
    entity["your string property name"] = "String property value";) for all the 40 attributes I have in my custom entity ? And then, if I use

    CrmServiceRef.TargetCreateDynamic targetCreate = new CrmServiceRef.TargetCreateDynamic();

     

    targetCreate.Entity = new_customentity;

    will I not get a casting error ?

    Wednesday, July 22, 2009 6:53 PM
  • Hi, Glora.

    This is was the sample for any count of lines. And it is not necessary to use targetCreate to create entity.

    DynamicEntity entity = new DynamicEntity("Your entity name");
    entity["your string property name"] = "String property value";
    entity["your 2 string property name"] = "String 2 property value";
    entity["your 3 string property name"] = "String 3 property value";
    ...

    Guid entityid = crmservice.Create(entity);

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, July 22, 2009 7:25 PM
    Moderator
  • Hi,

    Can you you also provide how to fill values for a lookup by this method.

    Regards,
    Shivam

    Thursday, December 23, 2010 5:54 PM