New answers tagged

0

On which forms do you wish to add the fields/logic? I feel like there are two questions here: 1) How to build an arbitrary list of options from a third-party source of data (Drupal) 2) How to set the value of one field based on the value of another fields. For (1), arbitrary lists, you can look into hook_civicrm_fieldOptions, which can dynamically modify ...


0

Agree with Mick Kahn about using a note. As to the spinning cursor and deleting the field if you're unable to do it in the UI, the spinning cursor usually means a fatal error occurred somewhere, so check the web server logs or CiviCRM ConfigAndLog. To delete the custom field manually: Make a database backup. In the list of custom fields if you hover over or ...


1

You haven't said what field type you were using, but I think you should probably be using a note field rather than an alphanumeric. My understanding is that the note field isn't stored as fixed length.


2

If you have a report that doesn't show the custom fields on an entity, it might be because those fields are not configured as searchable (yes, a very non-obvious thing). If that's the issue, then it's the same as this question/answer: Custom fields in the Report Templates Alternatively, if it's a problem with the report itself, you can generally hack it ...


1

That table is defined in templates/CRM/Event/Form/Selector.tpl and changing that would require some level of coding (your profile suggests you have this skill). Changing the Selector.tpl template directly would solve your problem but is discouraged because it causes headaches when upgrading to new versions. Creating an extension is the preferred way to make ...


0

If you open the file that provides the report, you can generally add the custom fields with a single line. For instance, if you're using Extended Reports extension, the "Extended Report - Participant Line Items" report template is a good one to add contribution custom fields to. So, for instance, find the files for Extended Report. You can find their ...


0

This code worked for me: $contactId = CRM_Utils_Request::retrieve('cid', 'Positive');


0

I did this by using CiviCRM hooks (BuildForm). ($form == CRM_Core_Action::ADD) { $currentDate = date('d/m/Y'); for ($i = 1; $i < 10000; $i++) { $defaults['custom_197_-' . $i] = $currentDate; $form->updateElementAttr('custom_197_-'. $i,array('readonly')); } $form->setDefaults($defaults); ...


0

Multi-value (also called multi-record) custom fields can't be exported by the normal export. See https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/#multiple-record-fieldsets. However you can get round this using a report than exporting as CSV. Two caveats. Not all reports will include the multiple values. Constituent detail ...


3

You can create custom fields under Administer --> Customize Data and Screens --> Custom Fields. You first create a custom group for the event. You could even limit this group to a certain type of event. You then add a field in this group with type Text and HTML type Select.


1

It appears to be a bug, but temporary workaround fixes the issue (split the fields into two custom field groups). Bug report can be found here: https://lab.civicrm.org/dev/core/issues/1330


1

Moe's answer is technically workable - but oof ouch my performance! Instead, something like this: function getElementNameFromFieldName($fieldName, $elementIndex) { // This function could be further optimized so it's only called once, but meh. $elementNames = array_keys($elementIndex); foreach ($fieldNames as $fieldName) { if (strpos($elementName, ...


1

With the help of JaapJansma-CiviCooP I was able to make this work using the below code: function dfi_civicrm_buildForm($formName, &$form) { if ( $formName == 'CRM_Contact_Form_CustomData' ) { for ($i = 1; $i < 10000; $i++) { $form->updateElementAttr('custom_198_'. $i,array('readonly')); $form->...


2

No that is not possible. The tokens in CiviCRM are used in letters/emails. So they are used for communication with the contacts in your database. Also note that a token in CiviCRM is always related to a contact.


Top 50 recent answers are included