Makes a property definition available for all of given attributes (it is created if it does not exist).
GSErrCode ACAPI_AttributeList_AddProperty ( API_PropertyDefinition& definition, const GS::Array<API_Attr_Head>& attrHeaders );
Parameters
- definition
- [in] The GUID of the definition (if already existing) or the data of the definition to create.
- [out] The GUID of the definition (if newly created) and the modified availability array.
- attrHeaders
- [in] The array of attributes, that the property should be available for.
Return Values
NoError
- The function has completed with success.
APIERR_NOACCESSRIGHT
- Do not have the right to create or modify a property definition on a teamwork server.
APIERR_NAMEALREADYUSED
- The name of the definition is already used in the given property group.
APIERR_READONLY
- Tried to modify a read-only property (for example a property coming from a hotlink).
APIERR_BADPARS
- The value of the definition is inconsistent, for example the default value has a different value type than the definition itself.
APIERR_BADVALUE
- One of enumerations did not have their value out of the allowed ones. This includes c++ enums (i.e. they were uninitialized or memsetted), and enumeration property values (the possibleEnumValues doesn’t contain the default value)
For other common API errors see the API Errors document.
Example
For more detailed examples, please see the Property_Test add-on.GSErrCode CreateExamplePropertyDefinitionForSelection (API_Guid groupGuid, const GS::Array<API_Attr_Head>& attributes, API_PropertyDefinition& definition) { definition.guid = APINULLGuid; definition.groupGuid = groupGuid; definition.name = "Property Definition"; definition.description = "An example property definition."; definition.collectionType = API_PropertySingleCollectionType; definition.valueType = API_PropertyBooleanValueType; definition.defaultValue.singleVariant.variant.type = definition.valueType; definition.defaultValue.singleVariant.variant.boolValue = false; return ACAPI_AttributeList_AddProperty (definition, attributes); }
Requirements
- Version: API 20 or later
- Header: ACAPinc.h