Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Help with workflow and how best to set up a role

  1. #1
    jkaver is offline Member
    Join Date
    Dec 2010
    Posts
    15

    Default Help with workflow and how best to set up a role

    Version 5.2.0l (Build 5843)

    Alright, here is what I'm trying to achieve, could someone give me a hand with this scenario, and how best to set it up.

    We are bringing in some lead generator sales people into our firm. Their job is only to bird-dog leads. I want to create a user/role, that can just create a lead, and access it to assign it to one of our sales staff. I've gone and adjusted all of the role management to just have access to contact and lead, only owner.

    What I'm running into is the generator creates a new lead, and assigns it, and when they save it, it disappears from their lead screen. It is created and assigned in Sugar, but I haven't been able to figure out the best way for them to still see it.

    Any suggestions on how to do this best?

    Thanks,

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Help with workflow and how best to set up a role

    Hello,

    The answer is tricky. But Role which will be applied like, user can see the records assigned to them, not the ones created by them!
    So, the possible solution is override the list view query and get the records which are belongs to them and created by them, without applying any roles to users.

    As it is Sugar module, we have to find a way to customize the way, to make the changes upgrade safe. So, you will need to follow the steps.

    Copy and paste the controller.php from modules/Contacts to custom/modules/Contacts and add following code in the class ContactsController

    PHP Code:
    function action_listview()
    {
        require_once(
    'custom/modules/Contacts/MyCustomListView.php');
        
    $this->view_object_map['bean'] = $this->bean;
        
    $this->view 'list';
        
    $GLOBALS['view'] = $this->view;
        
    $this->bean = new MyCustomListView();

    Now next step is to create a new file custom/modules/Contacts/MyCustomListView.php and following code there.

    PHP Code:
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    // extending list view query THE UPGRADE SAFE WAY..........
    class MyCustomListView extends Contact
    {
        function 
    create_new_list_query($order_by$where,$filter=array(),$params=array(), $show_deleted 0,$join_type=''$return_array false,$parentbean=null$singleSelect false)
        {
            global 
    $current_user;
            
    $and "";
            if(!empty(
    $where))
                 
    $and " AND ";
            
    // Adding Extra Condition to allow users to view records created by them.
            
    $where .= " ".$and."(contacts.assigned_user_id = '".$current_user->id."' OR contacts.created_by='".$current_user->id."')";

            return 
    parent::create_new_list_query($order_by$where$filter$params$show_deleted$join_type$return_array$parentbean$singleSelect);
        }

    P.S. DONT put role List > Owner.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  3. #3
    jkaver is offline Member
    Join Date
    Dec 2010
    Posts
    15

    Default Re: Help with workflow and how best to set up a role

    Hi David,

    Will this allow the "user" to just see the leads they create, and not the leads of the rest of the staff? I really want the lead generators segregated from the rest of the company, so just their leads, even when they are assigned to someone else?

    Thanks for your help, had a feeling it would take some modifying to do it.

  4. #4
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Help with workflow and how best to set up a role

    Hello,

    This will allow user to see what they have created and the leads assigned to them. As it is leads, you will have to do everything inside custom/modules/Leads instead of custom/modules/Contacts. I referred as Contacts, you simply follow the steps for Leads.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  5. #5
    jkaver is offline Member
    Join Date
    Dec 2010
    Posts
    15

    Default Re: Help with workflow and how best to set up a role

    Hi David,

    I noticed you listed:

    "P.S. DONT put role List > Owner. "

    Are you meaning that I can't use the role management, and set enabled to leads, and list view to owner?

    I am new to Sugar, so I want to set this up properly so I don't have to worry about it creeping up again.

    Thanks for your help and clarification.

  6. #6
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Help with workflow and how best to set up a role

    Hello,

    Yes, you will have to avoid that, as otherwise it will remove the records which are created by logged in user. If it is much sensitive data, you can ask users NOT to work until you are satisfied with the interface, or you can simply create a test instance to check the functionality and then put the changes on production!
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  7. #7
    jkaver is offline Member
    Join Date
    Dec 2010
    Posts
    15

    Default Re: Help with workflow and how best to set up a role

    Quote Originally Posted by davidboris View Post
    Hello,

    Yes, you will have to avoid that, as otherwise it will remove the records which are created by logged in user. If it is much sensitive data, you can ask users NOT to work until you are satisfied with the interface, or you can simply create a test instance to check the functionality and then put the changes on production!
    So from what I gather, I can use role management to disable access to everything but the Leads tab? But what about the rest of the company who does need access to the main leads?

  8. #8
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Help with workflow and how best to set up a role

    Hello,

    Ouch! Then there will be an extra customization of creating new field in Users, put that in edit view, through which Admin can decide if the user is allowed to see records which are even created by them! Long trip!! Much customizations.. Up to my knowledge, this is what I think is the solution.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  9. #9
    jkaver is offline Member
    Join Date
    Dec 2010
    Posts
    15

    Default Re: Help with workflow and how best to set up a role

    Hi David,

    Any other options then?

    Basically I have multiple users, some of which can access everything, (as admins) some who have access to most everything, and then this special group of users who just create leads, and assign them, nothing more..

    Is there a better way to do this in Sugar?

  10. #10
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Help with workflow and how best to set up a role

    Hello,

    The perfect one is Role only.. It's just that it will not allow the users to see the records created by them but assigned to someone else. I will see if there is any other way to accomplish the same with Roles Management only. As soon as I find something, I will post the solution here, but more likely it will be un-upgrade safe.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2010-11-24, 10:54 AM
  2. opt in role
    By Meyer in forum Help
    Replies: 0
    Last Post: 2009-05-27, 07:51 PM
  3. role without name
    By ghorg in forum Help
    Replies: 5
    Last Post: 2008-04-18, 08:32 PM
  4. Role management
    By lamezia5 in forum General Discussion
    Replies: 2
    Last Post: 2006-11-30, 09:26 AM
  5. Role to za mało?
    By maciekkw in forum Polish
    Replies: 2
    Last Post: 2006-05-10, 07:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •