1

I want to create a relationships field on a contact profile like the 'Current Employer" field. I want to be able to access this new field rather than using the 'Relationships' tab.

Why? I want to retain the 'Current Employer' field. My client, Navy Sailing has over 180 branches around the world. We assist with the management of contacts that belong to those branches (organization), and creating a contact relationship with those branches seems to be the best way to manage the requirements. I need the field on the profile in order to make it easier administrators to edit and to view, rather then multiple clicks to use the tab. (and needs to be an obvious piece of data on the profile)

Is there anyway to get a relationships field on the profile, e.g. directly under the 'Current Employer' field OR in a custom field set elsewhere on the profile???

Carl

1

The "Current Employer" field is special in that the employer_id is actually stored on the contact record (in the civicrm_contact table on the underlying database). All other relationships are stored only in civicrm_relationship.

Nevertheless, you could fake this:

  • Create a custom field of type "Contact Reference". This by itself might meet your needs - do you still need a relationship if you have a contact reference field?
  • If so - you can write an extension (if you're not a coder, you can hire one to do this for you) that fires on hook_civicrm_custom. When they contact reference field is changed, a corresponding relationship can also be updated.
  • Hey, Jon! Thanks! Functionally, does the 'Current Employer' field do anything different than the 'Contact Reference' field? I.e. would I be missing something based on my original requirement? I guess what I'm asking is: architecturally, is the 'current employer' field a unique structure (other than the employer_id being held in the db)? Looking at it another way, the "Current Employer" would work well as a branch organization, but semantically it wouldn't make sense. – Carl Fusch Aug 30 '16 at 20:31
  • "Current Employer" is different in that there's some special code to handle it. E.g. when creating a new relationship of type "Employer/Employee", you can automatically set the "Current Employer". However, if the only issue is semantic, and you don't need to track current employer, you may want to see if using Word Replacements to replace "Current Employer" with your preferred language will get you the desired result! – Jon G - Megaphone Tech Aug 31 '16 at 17:04
  • Thanks, Jon! That's probably the path we will take. - Carl – Carl Fusch Aug 31 '16 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.