Posted in CRM, Plugin

Custom Entity creation through C#

CreateEntityRequest createrequest = new CreateEntityRequest
 {
 Entity = new EntityMetadata
 {
 SchemaName = "new_rakesh",
 DisplayName = new Label("rakeshs", 1033),
 DisplayCollectionName = new Label("rakeshs", 1033),
 Description = new Label("An entity to store information custom customer bank accounts", 1033),
 OwnershipType = OwnershipTypes.UserOwned,
 IsActivity = false,
 },
 PrimaryAttribute = new StringAttributeMetadata
 {
 SchemaName = "new_names",
 RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
 MaxLength = 100,
 FormatName = StringFormatName.Text,
 DisplayName = new Label("Names", 1033),
 Description = new Label("The primary attribute for the Custom entity.", 1033)
 },
 };
 service.Execute(createrequest);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s