0

If I create a new custom field with a Drop Down list, you can set a Default if you want, or leave it as blank (no default).

What I want to do is leave as blank (no default) when I use the field in one particular profile, but on another profile, I need it to default to a specific choice, and then on a third profile, I need it set again to another option.

EDIT: To add to this question... Is it possible to select a different default COUNTRY in different profiles as well?

1 Answer 1

1

So the only way I have figured out how to do this, is using the buildForm hook from an extension.

You would need to check what profile form id is and then make the changes to the specific fields as needed.

This thread has similar example but would need to be modified for a profile form: How to create a custom extension/module (with an example)?

Once in the buildForm hook, you would use something like this:

if ( $formName == 'CRM_Profile_Form_Edit' && $form->getVar('_gid') == 15 ) {
  //Do something with profile form that has gid = 15
}

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.