// ** Create a boolean attribute ** // Boolean attribute BooleanAttributeMetadata boolAttribute = new BooleanAttributeMetadata { // Set base properties SchemaName = "new_boolean", DisplayName = new Label("Sample Boolean", 1033), RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None), Description = new Label("Boolean Attribute", 1033), // Set extended properties OptionSet = new BooleanOptionSetMetadata( new OptionMetadata(new Label("True", 1033), 1), new OptionMetadata(new Label("False", 1033), 0) ) }; // Create the request. CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest { EntityName = "EntityLogicalName", Attribute = boolAttribute }; // Execute the request. _service.Execute(createAttributeRequest);