Voting
Collapse
X
-
I believe the code above is a method without using of Workflow.Originally posted by JosNasUPDATE: We purchased the Advanced Pack. I still need to find a way to implement voting using workflows though.
Personally I haven't use Workflow before so can't give you the details, you can try to read what we talk about and 'replicate' the idea. -
In which .php file did you add the method above? Also, our client told us of a 'minor' change in the flow. As before first a Lead is created -> but now 2 members from a 'Member Committee' check one of two boxes (Approved, Not Approved) and they can also check another checkbox (Vetted) -> when approved by those 2 members, this is when the lead goes to the Board Members for another approval -
Hi, you can find a sample method for achieving 1) -> 3) logic in my post above.
Note that I create entity "Vote", created relationship, created team "Board Members", created roles that user in that team can read only his (assigned) Votes etc.
Method to be executed in afterSave on Lead:
This method will create a Vote record for every user in the "Board Members" team and it will assign Lead and that user to Vote record.PHP Code:private function createVotesForBoardMember(Entity $lead) { try { $entityManager = $this->getEntityManager(); // Get a specific team by name - I used 'Board Members'. $boardMembersTeam = $entityManager ->getRepository('Team') ->where([ 'name' => 'Board Members' ]) ->findOne(); // List all of Users in that team. $boardMembers = $entityManager ->getRepository('Team') ->getRelation($boardMembersTeam, 'users') ->sth() ->find(); foreach ($boardMembers as $boardMember) { // Create a vote for each user in the team. $vote = $entityManager->createEntity('Vote', [ 'name' => 'Lead convert approval' ]); // Relate Lead to newly created vote. $entityManager ->getRepository('Lead') ->getRelation($lead, 'votes') ->relate($vote); // Relate user from team to newly created vote. $entityManager ->getRepository('Vote') ->getRelation($vote, 'assignedUser') ->relate($boardMember); } } catch (Error $error) { throw new Error($error); } }
If you have existing afterSave() method on lead, just simply add
to afterSave()PHP Code:$this->createVotesForBoardMember($entity)Leave a comment:
-
Hi, this is really interesting topic for finding a great solution. I have this concept in mind, but it requires a little decent EspoCRM programming experience.
Steps:
1) Create a new entity Vote / Converting Vote / Convert Vote (whatever name)
2) Create fields something like "Lead to be Converted" (lookup to Convert) and then lookup to user, that will be voting (board member).
3) afterSave logic on Lead entity (PHP programming) - when a lead is created, get BoardMembers team, and foreach user in that team create a record of "Vote", associate each user to it (requires iteration via foreach), same as the current lead -> it would automatically generate that voting entity for every board member
4) then the logic that would handle the voting count, or majority of votes - let's say at least 50 % need to agree
5) when the threshold would be OK, it would be able to convert the lead - or better, it would automatically convert the lead to contact
I believe this is great approach and you don't need Workflow extension at all - the logic I described is easier to program than to trying create it in Workflows
I like this idea, I think I'm gonna program it
Have a nice day!
Leave a comment:
-
I dont have Workflow either, it because you want it to be automated that why Workflow need to be use (otherwise you need to learn how to code, a topic I can only copy/paste from guide and tutorial).
I suppose you can have a designated person to be the "Converter", where he would check whenever it is greater than >6 he need to manually convert it.
if you don't need too much function of EspoCRM (which it can do many thing), but where the Vetting process is what is important, perhaps choosing another CRM system where Workflow is free might be a wiser choice. Or one that might be able to serve your purpose a little easier.
Another idea I just thought of is, "Multi Field" for each of your board members, it not hard if there isn't too many, but if too many it might be annoying to do. This method should help you do it all for free, probably can adopt it for other CRM system too!
Everyone go into Contact, whether or not they are a member or a "applicant".
By default they are Applicant (not unless they already a member).
Have 12 fields (assuming you have 12 board members).
Each field have two option available, (maybe 3), "Accept" "Decline" "Ban" (the 3rd option).
Each field is accessible only by 1 person for each field, they would need to click Accept or Decline.
After that you can use Formula to count whenever it is Greater then >7 "Accept", then change Status from "Applicant" to "Member". And maybe if, >4 Ban then Member/Applicant get convert to "Ban".
I think with this way it is also a good option that is possible using the free tools available, learning curve isn't too difficult, might be annoying to set up at first with 12 field though.
Leave a comment:
-
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Interesting concept. Firstly I'm not sure on how to tackle this problem in a good way, for me I would try to do something like this. Do note that I have no experience in using the Workflow. Another issue is, on how you can get the "Accept" button to the Leads area.
(1) Automatic generate "Meeting" for each new leads
(2) In the Meeting workflow, auto add all of the Boards Members
(3) (not sure if this one possible), count how many of the Contact/User accept the meeting. If >7 then
(4) Convert to Contacts.
It is a semi-poor man workaround method I would adopt if I were force to use this, of course you have to make it easier for the user (your board members). Perhaps creating a new entity that is a Meeting type but call it, "Vetting the new lead" would be better so you won't mix Meeting with this Vote/Approve entity.
Perhaps other people would have a better member (surely my method is one of the worse). If you have coding ability then it could be better for sure.
---
That said, here is a plugin of my 'wiki' a collection of thread curated during my EspoCRM usage: https://github.com/o-data/EspoCRM-Le...nd-Design/wiki
Please note that I'm just an user like yourself.
Hello, thank you for your reply. Your approach is quite interesting.
However another current limitation is I don't have the workflow package installed which is why I may want to find another solution that doesn't require using the Workflow (although my manager and I are considering purchasing it but not at the time being unless we must).
That said, your approach still quite makes some sense, especially that out customer (the highest board member) did also mention a 'Vetting Process' that they usually adopt when a new member is joining their organization.Leave a comment:
-
Interesting concept. Firstly I'm not sure on how to tackle this problem in a good way, for me I would try to do something like this. Do note that I have no experience in using the Workflow. Another issue is, on how you can get the "Accept" button to the Leads area.
(1) Automatic generate "Meeting" for each new leads
(2) In the Meeting workflow, auto add all of the Boards Members
(3) (not sure if this one possible), count how many of the Contact/User accept the meeting. If >7 then
(4) Convert to Contacts.
It is a semi-poor man workaround method I would adopt if I were force to use this, of course you have to make it easier for the user (your board members). Perhaps creating a new entity that is a Meeting type but call it, "Vetting the new lead" would be better so you won't mix Meeting with this Vote/Approve entity.
Perhaps other people would have a better member (surely my method is one of the worse). If you have coding ability then it could be better for sure.
---
That said, here is a plugin of my 'wiki' a collection of thread curated during my EspoCRM usage: https://github.com/o-data/EspoCRM-Le...nd-Design/wiki
Please note that I'm just an user like yourself.Leave a comment:
-
Voting
Hello, I have created a form that once is filled, creates a Lead (Lead Capture).
I have also created 12 Users that belong to a Team called 'Board Members'. What I am trying to do is, I want those Board Members to convert the Lead to a Contact, but only after they vote/approve to do so (or the majority converts that Lead to a Contact). Any ideas on how to tackle this is much appreciated.
(Note: I am still relatively new to Espo, and I also don't mind coding if necessary). Thank you in advance.Tags: None

Leave a comment: