CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(_context, _context.getServiceContent().getCustomFieldsManager());
int key = getCustomFieldKey(fieldName);
if (key == 0) {
try {
CustomFieldDef field = cfmMo.addCustomerFieldDef(fieldName, getMor().getType(), null, null);
key = field.getKey();
} catch (Exception e) {
// assuming the exception is caused by concurrent operation from other places
// so we retieve the key again
key = getCustomFieldKey(fieldName);
}