The setCustomListFields() method changes the list of custom (non-standard) fields for the specified list.
Warning: This call will remove any custom fields that are already present in a list if those custom fields aren’t provided in the fields argument. When adding new custom fields to a list, you should first obtain a list of the current custom fields, add the new fields to it, and call setCustomListFields() with the combined list of field names.
Warning: This call will remove any custom fields that are already present in a list if those custom fields aren’t provided in the fields argument. When adding new custom fields to a list, you should first obtain a list of the current custom fields, add the new fields to it, and call setCustomListFields() with the combined list of field names.
Input
[vrtypens:setCustomListFieldsArgs]
session_id [xsd:string] (required)
Your API session id.
list_id [xsd:int] (required)
The id of the list whose custom field names are being set.
fields [vrtypens:ArrayOfString] (required)
The names of the custom fields that should exist for this list.
widths [vrtypens:ArrayOfString] (required)
An array of widths for the custom fields. This array should match 1 on 1 with the fields array.
Allowed widths: “small” (25 characters), “medium” (125 characters), “large” (255 characters). Defaults to “medium”.
Allowed widths: “small” (25 characters), “medium” (125 characters), “large” (255 characters). Defaults to “medium”.
Output
[xsd:boolean]
Examples
PHP
$vr->setCustomListFields( array(
'session_id' => $sid,
'list_id' => $lid,
'fields' => array( 'dog_name', 'cat_name' ),
'widths' => array( 'medium', 'medium' )
) );
Ruby
vr.setCustomListFields({
'session_id' => sid,
'list_id' => lid,
'fields' => [ 'dog_name', 'cat_name' ],
'widths' => [ 'medium', 'medium' ]
})
Java
String[] fields = {"dog_name", "cat_name"};
String[] widths = {"medium", "medium"};
SetCustomListFieldsArgs setCustomListFieldsArgs = new SetCustomListFieldsArgs();
setCustomListFieldsArgs.setSession_id(sessionID);
setCustomListFieldsArgs.setList_id(listID);
setCustomListFieldsArgs.setFields(fields);
setCustomListFieldsArgs.setWidths(widths);
vr.setCustomListFields(setCustomListFieldsArgs);
C#/.NET
string[] fields = new string[2] { "dog_name", "dog_name" };
string[] widths = new string[2] { "medium", "medium" };
setCustomListFieldsArgs sCLFA = new setCustomListFieldsArgs();
sCLFA.session_id = sessionId;
sCLFA.list_id = listId;
sCLFA.fields = fields;
sCLFA.widths = widths;
try
{
objVR.setCustomListFields(sCLFA);
}
catch (Exception e)
{
System.Console.WriteLine(e.Message);
}
Perl
$vrapi->setCustomListFields( {
session_id => $sid,
list_id => $lid,
fields => [ 'dog_name', 'cat_name' ],
widths => [ 'medium', 'medium' ]
} );
