Creates a contact data field within the account
This method can be used to create a contact data field within your account.
You can't create a contact data field that already exists. If you are unsure which data fields currently exist, please call GetDataFields.
The contact data field's name can only be up to 20 characters in length and must consist of alphanumeric characters only, with hyphens and underscores if required. The contact data field that is created will be private by default. The amount of contact data fields you can create will be limited by the account type you have.
SOAP action: http://apiconnector.com/v2/ApiService/CreateDataField
Input and output parameters
The input and output parameters for this method are:
Input parameters
- DataField
- Name - required; string
- Type - required; string ('String', 'Numeric', 'Date', 'Boolean')*
- Visibilty - optional; string ('Private', 'Public')*
- DefaultValue - optional; anyType
Output parameters
- CreateDataFieldResult
- DataField
- Name - string
- Type - string ('String', 'Numeric', 'Date', 'Boolean')
- Visibilty - string ('Private', 'Public')
- DefaultValue - anyType
Example
using (var client = new ApiServiceClient())
{
client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "password";
var dataField = new ApiDataField
{
Name = "TestDataField",
Type = ApiDataTypes.String,
Visibility = ApiDataFieldVisibility.Public
};
var createdDataField = client.CreateDataField(dataField);
}