Creating an Organization, Contact and activity at the same time.

Events happening in the community are now at Drupal community events on www.drupal.org.
iwant2fly's picture

I have been evaluating RedHen and to a lesser extent crm_core, and am running onto a missing feature that I would have thought was pretty common. Am I am missing something obvious.

I want to be able to create an Organization (Company), Contact, and take activity notes on that interaction all at once on one form. The use case would be someone I have never talked to before calls in, and I take down all their information while on the phone, and want to record their request as an activity. With the out of the box setup this is a three step process; creates an organization, create a contact and attache it to the organization, and then finally create an activity.

In a similar vein when looking at an organization I would like to be able to add contacts without leaving the page, and have the relationship be prepopulated based on the current organization page I am on. The same thing for creating activities.

Is there a way to do this?

Comments

Right on

chopper_elation's picture

I seriously thought you were commenting on something I asked. :) I have the exact same need. I'm sure there's a way to do it with Rules but I also think this scenario sounds like normal operating procedure that should be built in.

I'd be willing to try and work through this with you and come up with a solution. Perhaps by bouncing ideas around we can figure this out.

Yeah I have been trying to

iwant2fly's picture

Yeah I have been trying to figure this out for a little while. crm_core has part of this capability when you use their form builder https://drupal.org/project/crm_core_profile. With that you can create a contact or company, and record an activity at the same time. What you can not do with that is create a company and a contact on the same form. I am not a developer (yet), but I think that the complication comes in with the relationships. To create a relationship, you need to know the endpoint of at least one side when the form is submitted, and when entering the info for both sides in a single form, neither side exists yet. I think with a little code to behind the scenes create one entity, and then create the second entity and the relationsip, that this should be very doable, but sadly I don't have the skill to do it. I do have a good outsource partner I was thinking of paying to do this, but I need to narrow down my request to precisely what I need.

Can you give me a little more detail on your use case. That might spur some thought on my end. I would love to come up with a good general use solution to this rather than something hacked together for my specific needs.

redhen workflows...

ahillio's picture

Hi follks. Yes this would be very useful. I'm guessing the reason this kind of thing isn't made already is that there are just so many possibilities of how workflows should go that it just wasn't possible to add this workflow customization to the framework, so these steps are all separated by mouseclicks.

Here's my thoughts on this, having used Drupal for a while (tinkered with Redhen for 7months) and now learning to code...

General idea is to group these steps into a process. So "create new lead" would be an example process encompassing three steps:
1) Create new organization, and via inline_entity_form create new contact (organization bundle will have entityreference field (using inline_entity_form widget) for "first contact" or such)
2) Create the relation - is this person department head, sole prop, etc of the organization
3) Add notes.

These three steps would still be have their separate forms, as they currently do, but they would be sequenced so that when you're in the midst of a process and click the save organization button you get redirected to the create relation form, and upon saving that you get redirected to the notes form.

Separating this process into multiple steps resolves the issue of creating a relationship when there's no entity for its' endpoint.

Step 2 could possibly be done with Rules instead of actually filling out the form, but I'm not sure if the relation entity's fields (ie organization role and affiliation status) could be filled out... they probably could. The values would need to be specified on that form somehow, perhaps in a field group or collection. So maybe this action could be triggered by step 1, then you get redirected to step three.

Fun :)

That gets us partway there

iwant2fly's picture

That is solution that has some promise. I think the good part is that most of that could be done with rules with very little modification. I see two issues or things that would need some coding.

  1. Automatically creating or at least prepopulating the relationship on the subsequent forms so the end user does not have to enter it. It doesn't appear that there is an out of the box way to do this at the moment. Might be able to do it with tokens to pull an argument that rules put into the redirect URL...

  2. This approach forces a linear workflow. That will work for many cases, but for my original example of a phone call, it woudl be great to have one form you coudl fill out in any order. Customers don't like to follow your workflow. They call in and want to discuss a solution and I may get a lot of information I need to record, before ever getting their name or contact information. If we collect the information all together before hitting submit it would make the workflow much more flexible.

Personaly, and this is of course biased on my use case, I think a much more flexible way to collect information across the board would allow for a lot more options for workflows in other use cases.

You're right. Custom forms

ahillio's picture

You're right. Custom forms would be much better than custom workflows.

I wonder if this could be achieved simply with Entityforms + Rules.

If you create the contact for the organization with inline entity form perhaps Rules could do everything needed upon form submission?

Good idea thanks. I will see

iwant2fly's picture

Good idea thanks. I will see how far I can get without coding.

Have you tried that? I

ahillio's picture

Have you tried that? I probably wouldn't have thought of that if we hadn't discussed it. If it works the way think it should, it could be a pretty awesome tool for Redhen - and it's already built! I'm hoping to try it out myself as soon as I'm able to for my own project but have other peoples work to do first. Would love to hear how it goes for you!

RedHen CRM

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: