Our app dynamically created a Drilldown (Select) Custom Field successfully before. Now, we need to dynamically create a List Box. But I can’t seem to figure out the correct “DataType” value for it.
WHAT WE DID:
We’re about to send these values to DataService.addCustomField
array:4 [▼ "customFieldType" => "Contact" "displayName" => "XXXXX" "dataType" => "Option List" // <-- what we need to figure out "headerId" => 47 ]
We then get an error that says:
[InvalidParameter]The data type “Option List” is an invalid type
WHAT WE TRIED:
We tried to look for something in this guide. However, it only mentions Text, Select (Used for Dropdown), TextArea. It didn’t say anything about “List Box”.
We also checked here but it also doesn’t say anything about what “dataType” to use when creating “List Box” thru the API.
We tried doing all these below as a possible “dataType” values to create List Box. But the same “invalid type” error still shows.
“17” <-- sent as a string, because ListBox DataType integer is 17.
17 <-- sent as an integer. Returns “no method matching args” error instead.
- Lastly, we tried creating a record directly at DataFormField group by executing
request('DataService.add', 'DataFormField', $values)
$values = [ "Label" => "XXXXX", "DataType" => 17, "ListRows" => 0, "FormId" => -1, "GroupId" => 47, "Name" => "XXXXX" ];
Although no error occurred, but the return value is FALSE. No new custom field was created when checking Infusionsoft too.
Is it possible to create a custom field List Box? and if so, what “DataType” value do we need for it?
Or maybe we missed something from the steps we did above?