// ** Create a picklist attribute (Option set) ** PicklistAttributeMetadata pickListAttribute = new PicklistAttributeMetadata { // Set base properties SchemaName = "new_picklist", DisplayName = new Label("Sample Picklist", _languageCode), RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None), Description = new Label("Picklist Attribute", _languageCode), // Set extended properties // Build local picklist options OptionSet = new OptionSetMetadata { IsGlobal = false, OptionSetType = OptionSetType.Picklist, Options = { new OptionMetadata( new Label("Created", _languageCode), null), new OptionMetadata( new Label("Updated", _languageCode), null), new OptionMetadata( new Label("Deleted", _languageCode), null) } } }; // Create the request. CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest { EntityName = "EntityLogicalName", Attribute = pickListAttribute }; // Execute the request. Get Response CreateAttributeResponse resp = (CreateAttributeResponse)_service.Execute(createAttributeRequest);