I have created a multi-select attribute(attribute_code is address_purpose) for the customer using UpgradeData
The options are created and the values are getting stored if I edit in magento admin.
But they are not updating once updated programmatically with addressId.
I have two Options Delivery, General.
So I am updating address using below code with the addressId.
$addressPurpose = array("Delivery","General");
$shippingAddressId = 15;
$address = $this->_addressRepository->getById($shippingAddressId);
$address->setCustomerId(1);
$address->setFirstname('test');
$address->setLastname('test');
$address->setCountryId('GB');
$address->setPostcode('TW9 1AF');
$address->setCity('Test');
//$address->setData('address_purpose',$addressPurpose);
//$address->setAddressPurpose($addressPurpose);
$address->setCustomAttribute('address_purpose', $addressPurpose);
$address->setTelephone('1213323213');
$this->_addressRepository->save($address);
This code is not saving value for my custom attribute(address_purpose).
What is the problem here? Please, anyone support on this issue. Thanks