Hi :wave: How do you update the name of a contact ...
# suitescript
e
Hi ๐Ÿ‘‹ How do you update the name of a contact record? When I save it I get
CONTACT_ALREADY_EXISTS
๐Ÿค”
Copy code
var rec = record.load({
    type: record.Type.CONTACT,
    id: contactId
});
rec.setValue({ fieldId: 'middlename', value: middlename });
rec.save();
b
Does this happen for all records or just one in particular? Have you checked for duplicates? Have you tried a different value?
e
Happens for all contact record. Seems the name must be unique, and even if it has not changed I still can try to set the value
Is there a setting that lets me add two contacts with the same name?
b
I don't think there is a way around that for contacts associated with the same company record.
s
The full name, which I think is
entityid
, has to be unique within the same company, and I donโ€™t think that restriction can be changed. We have a few large companies where two people had the same name. You can either add a middle initial (if known and if different), or employ a workaround adding something unique to the name, like a number (1, 2, 3) to the end, phone extension, or job title, to make them unique.
๐Ÿ™ 1
e
Thank you helping @Ben Tanner and @scottvonduhn