1

I'd like to be able to bulk update the status of activities (that happen to be on a case) from a view.

I can get the status to update but the problem is it loses the Case ID along the way. For example, prior to updating the activity, say it was connected to case 1234. After I run the Bulk Update to change the status of the activity, it sets the case number to 1.

Any idea how to overcome this? (I'm in Drupal 7.)

Update: When I add the CiviCRM Activities: Case ID field to the view I get an error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_activity.case_id' in 'field list'

The field should be civicrm_case_activity.case_id but I can't find in the code of CiviCRMEntity where to make that change.

14
  • if it does lose it then it would need some fix to the code. i think we added the 'update activity' code so i can ask my colleague when he is around. ps pls mark as D7 or D8
    – petednz - fuzion
    Oct 8, 2020 at 20:44
  • @petednz-fuzion Doh, rookie mistake. I'm in Drupal 7.
    – RayWright
    Oct 8, 2020 at 21:08
  • not so much a mistake - more that as more sites start using D8 the more we need folk to think to mention what version they are on since the number matters - I will add the d7 tag for you but hoping you can next time.
    – petednz - fuzion
    Oct 8, 2020 at 21:30
  • Totally. I went to add it and didn't see it under the search term 'drupal'. I think because there are som many results now it falls off the selector page. Now I know to use drupal-7 to find the tag.
    – RayWright
    Oct 8, 2020 at 21:32
  • i agree it is not showing. it used to be an Alias for Drupal and since deleting the alias so we can use it perhaps something hasn't let it show in the searches. i would have to chase this up in a meta channel but will have to wait for my annoyance level to rise enough
    – petednz - fuzion
    Oct 11, 2020 at 22:07

1 Answer 1

1

Initially, when I built my view I was missing some relationships - thus the SQL error mentioned above. But even after adding the correct view relationships, the issue still persisted.

I got huge help from @jackrabbithanna on mattermost. He provided code for a civicrm_customs.module file that will give an "Update Activity Status" VBO action. https://gist.github.com/jackrabbithanna/34016f1e3dac7c1b44a893cc93eed6db

In notes from his chats:

this provides a separate action, not using "Modify Entity Values" action . . . that sidesteps the entity form irregularities

could do lots of complex things or whatever with API .. but this shows how to make own VBO action to people

Your Answer

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

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