I have a custom field multiselect address field on...
# suitetalkapi
b
I have a custom field multiselect address field on a Project and I'm having a lot of trouble tying addresses to it. Does anybody have any code snippets of how you do it? If I try to do a ListOrRecordRef, it tells me it's an invalid key.
Right now, this is essentially what I have:
Copy code
$projectLocation = new ListOrRecordRef();
$projectLocation->internalId = $address->internalId;

$projectWorkLocations[] = $projectLocation;

$workLocations                 = new MultiSelectCustomFieldRef();
$workLocations->scriptId       = self::CUST_ENTITY_PROJ_LOC;
$workLocations->value          = $projectWorkLocations;
$project->customFieldList[]    = $workLocations;
And I'm getting this response: Invalid custentity_project_work_locations reference key 58818.
CUST_ENTITY_PROJ_LOC = custentity_project_work_locations
nevermind, figured it out by adding data to the field and then pulling the record down
Had to use the address book rather than the address itself