I am using C# and MM 6
I am trying to programatically add custom properties to a topic.
//register the new bus type.
MM.IBusinessType aBusType = applicationObject.BusinessTypeRegistry.RegisterBusinessType("http://ebr.com/siptype/2007", ""); aBusType.DataContainerType = MM.MmDataContainerType.mmDataContainerTypeCustomProperties;
//associate the central topic with the new bus type
MM.Topic centralTopic = applicationObject.ActiveDocument.CentralTopic;
MM.BusinessTopic btopic = centralTopic.BusinessTopic;
btopic.BusinessTypeUri = "http://ebr.com/siptype/2007";
//get the data container from the topic
MM.CustomProperties box = centralTopic.DataContainer.CustomProperties;
//I initially tried this approach which I found on your website but I keep getting an illegal argument exception
//box.SetCustomPropertyValue("firstname", "Bernie");
//box.SetCustomPropertyValue("http://ebr.com/of/string/lname", "Smith");
//so i tried this below
//get the custom property collection from the container
MM.CustomPropertyCollection props = box.CustomPropertyCollection;
//add a new custom property
MM.CustomProperty testProp = props.AddCustomProperty("http://ebr.com/cp", "firstname", MM.MmCustomPropertyFormatType.mmCustomPropertyFormatTypeText);
testProp.Basic = true;
testProp.Value = "Bernie";
//but i continue to get errors.