// ** Create a date time attribute ** DateTimeAttributeMetadata dtAttribute = new DateTimeAttributeMetadata { // Set base properties SchemaName = "new_datetime", DisplayName = new Label("Sample DateTime", 1033), RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None), Description = new Label("DateTime Attribute", 1033), // Set extended properties Format = DateTimeFormat.DateOnly, ImeMode = ImeMode.Disabled }; // Create the request. CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest { EntityName = "EntityLogicalName", Attribute = dtAttribute }; // Execute the request. Get Response CreateAttributeResponse resp = (CreateAttributeResponse)_service.Execute(createAttributeRequest);