0

I am trying to create a custom field set that will add additonal fields to a new activity type I have just defined. The activity type can be used for Contacts and Cases.

When I try and create the custom field set and select 'Used for' Activities, the drop down list of activities does not contain the new Activity I have created. It seems to stop at a certain point. What am I missing?! I have had no problems in the past.

I am using CiviCRM v5.41 with Drupal 7.82

1 Answer 1

1

OK - it took me quite a while, but this answer gave me a clue:

Activity drop down list not displaying activites

The issue was that the value of filter was set to null. I used the API explorer to compare an activity I could see:

{
"id": 123,
"option_group_id": 2,
"label": "My Visible Activity",
"value": "50",
"name": "My Visible Activity",
"grouping": null,
"filter": 0,  //Note that filter is set to 0 
"is_default": false,
"weight": 81,
...
}

with one I could not see:

{
"id": 1234,
"option_group_id": 2,
"label": "My Invisible Activity",
"value": "50",
"name": "My Invisible Activity",
"grouping": null,
"filter": null,   //note that filter is set to NULL
"is_default": false,
"weight": 81,
...
}

I then used an API call to update the the value of 'filter' to 0 and it appeared correctly in the dropdown list.

To update an activity you have created and make it visible, here is an example using CV, but you can of course use the API Explorer to do the same thing:

  1. Get the values of the exisitng activity types:

    cv api4 OptionValue.get '{"where":[["option_group_id","=",2]],"limit":500}'

    This will give you a list of all your activity types and the various values defined.

  2. Update the value of the Activity Type by setting the value of 'filter' to 0:

    cv api4 OptionValue.update '{"values":{"filter":0},"where":[["option_group_id","=",2], ["id","=",1234]]}'

This will now show up when you wish to add the custom field set for a particular activity type.

What I do not understand is why Activity Types I have created in the past have a filter value set correctly, but more recent ones do not. There is not an obvious way within the UI to enable or disable the visibility of individual Activity Types?

5
  • and you created the problematic Activity Type via the normal UI?
    – petednz - fuzion
    Commented Sep 28, 2021 at 19:35
  • Sorry Peter for the delay in replying - yes, through the UI. I just tried it again on my current clone of live (Civi5.41, Drupal 7.82) To reproduce, create a new activity type via UI menus i.e.- Administer/Customize data and screens/Activity types/Add Activity type [domain/civicrm/admin/options/… I used for Contacts and Cases. Then go create a Custom Field set through the UI - the newly created Activity type will not be in the dropdown.
    – ChumKui
    Commented Oct 20, 2021 at 9:50
  • I just tested on dmaster.demo.civicrm.org/civicrm/admin/custom/…. created an Activity Type = testtesttest, went to add Custom Field set. set it to Activities, check the drop down under Activities and see testtesttest. I don't u'stand why we are getting different outcomes.
    – petednz - fuzion
    Commented Oct 20, 2021 at 20:59
  • 1
    It must be to do with my set up somewhere along the line - no idea why. I have just found another instance. I think out it down to experience. The joys of software....
    – ChumKui
    Commented Nov 7, 2021 at 18:25
  • Thx for commenting back. Best if you can put an Answer saying 'something', then this can get closed and you get a few more points
    – petednz - fuzion
    Commented Nov 7, 2021 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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