R. Matveev R. Matveev - 1 year ago 93
C# Question

CRM : Can not set lastusedincampaign field while creating entity

I am creating a new

record and I need to set
field while creating. But my entity is being created with empty
I only can set it programatically with
method after

Where the problem can be?

P.S.: Creating and then updating my entity record is not a good idea, cause I have about 4k entity records to create at once.

UPDATE 1 (test code):

Entity contact = new Entity("contact");
contact["fullname"] = "New contact";
contact["lastusedincampaign"] = DateTime.UtcNow;

Answer Source

Looks like CRM ignores lastusedincampaign attribute like it does a few other during create operation. If you do not want to perform create/update operations at the same time, why don't you create a temporary workflow that would run asynchronously and update the field's value? This way async server takes most of the load and the record creations are faster.

Side note 4k records is not an awfully lot of records to perform a create/update simultaneously, I have worked with records in the tens of thousands and CRM never bottle necked on me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download