Results 1 to 7 of 7

Thread: Lead relationship to ProspectList

  1. #1
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Lead relationship to ProspectList

    So I'm keeping track of where leads come from by auto-adding them to prospect lists under leads.

    However I can only view them through the prospect leads themselves, I'd like to be able to see them on listview.

    However, I have no ability to add the column, do I need to manually do this in vardefs? Studio has me stumped and I'm slowly creeping around module files trying to see what I can do.

  2. #2
    salesagility's Avatar
    salesagility is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    UK
    Posts
    2,379

    Default Re: Lead relationship to ProspectList

    The best way to keep track of where leads come from is to use the Lead Source drop down .. you can customise this to suit

  3. #3
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Lead relationship to ProspectList

    Quote Originally Posted by salesagility View Post
    The best way to keep track of where leads come from is to use the Lead Source drop down .. you can customise this to suit
    Well but they're already in the prospect list, which is working great (I can easily add new prospect lists based on campaigns). I just need to be able to pull the reverse relationship. (I'm sure if you saw the full workings of our campaign module setup, you'd agree too it's rather nice I think, and makes the report dashlet I'm writing extremely easy to navigate, use and write.)

    We thought of doing it that way, but it seemed a bit messy to keep track of them that way (regular users CANNOT edit prospect lists, therefore the system can only set their prospect list and the user can never tamper with them [ex: make them a personal lead, which they get more commission on]), I could write a script to update them based on the prospect list and cron job it, but I'd much rather make use of the active relationship and use the prospectlists table where type='lead' being as it's an extremely effective method.

    If this is joined to the opportunity, campaign, and prospect table, why can't I join it with the prospectlists table?

    And if I can by editing files, how would I? I just need the prospect list name, a link would be nice, but not necessary.


    I can easily write a custom query to do what I need, but I have no clue how to implement custom DB query fields in listviewdefs.php, I only know how to do custom HTML code.

    http://www.sugarcrm.com/forums/showthread.php?t=47739
    That thread seems to do what I need, let me investigate... for the biggest question... where should I define my custom function? In the listviewdefs.php? That wont be overwritten when a change is made will it?
    Last edited by wdroush; 2009-11-12 at 04:33 PM.

  4. #4
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Lead relationship to ProspectList

    So far the closes I got is this:
    PHP Code:
    [LeadsQUERY_ARRAY] => Array
                    (
                        [
    1] => 1d037911-0a01-4645-d254-4ae22d12da09
                        
    [2] => 6093597d-7ed3-1e2c-d61e-4ae22d4bca06
                        
    [3] => 5d780836-6a11-837a-37ce-4af9f3395e53
                        
    [4] => 48e3e947-5e01-5ec2-2a77-4af9ee422a92
                        
    [5] => da99a2d1-e17a-52ff-e7bd-4ae1d8e34220
                        
    [6] => 4a20042a-8c0c-1d52-e10e-4aef47b73ccd
                        
    [7] => c3e50568-e3aa-f65f-efd5-4ae1e9d3b653
                        
    [8] => de084bc4-924b-74b7-1338-4af9ee820b76
                        
    [9] => 6eb33416-dcf2-6f99-b7a1-4ae22d302067
                        
    [10] => ccf375e2-7071-71a4-023b-4af9eecb0ea6
                        
    [11] => 5041d185-5247-c864-e221-4af9f37d7f14
                        
    [12] => b1b447d4-49ca-988d-bb56-4af9eeadaf6b
                        
    [13] => 9e2703e8-fe6e-b010-e611-4aef42a66f49
                        
    [14] => a3255c1b-70ae-93c5-fb06-4af9f475ab01
                        
    [15] => 82649399-716b-de05-5c72-4af9f4373e55
                        
    [16] => 21c3559e-e7f8-09cc-c23a-4af9eeba459e
                        
    [17] => 686e4114-022b-28de-1e3e-4ae1d8eddd65
                        
    [18] => 995916ed-95b0-2e3f-512b-4ae22ee43693
                        
    [19] => bcdb7ef3-002b-c1f0-4b1c-4aef47d87be9
                        
    [20] => b380fc05-5136-a6c5-9178-4aef479ac814
                        
    [21] => 9fe98d32-3db6-c2a9-7dd0-4aef47fc4b0c
                        
    [22] => 679a2985-3a18-37ba-2d84-4aef43d273b2
                        
    [23] => 232acda4-03c8-a037-f279-4aef433e64ad
                        
    [24] => 93733c60-55e1-d74e-b475-4aef4388d8f1
                        
    [25] => 7c3eca60-1f99-ae4a-125f-4aef437caa7a
                        
    [26] => 4d536db4-bf5e-3e34-78b6-4aef43827760
                        
    [27] => 1da2e375-78d8-5c59-1e0b-4aef42948ae3
                        
    [28] => cd46d152-58b1-9b47-73ca-4aef42e38ff4
                        
    [29] => 55402c12-5b33-2ed2-4380-4aef42fc7354
                        
    [30] => dd545500-2a09-829c-53d8-4aef42240e2c
                        
    [31] => f1d6f497-a74d-e42f-e19e-4aef42260949
                        
    [32] => 705ba2c8-f1f3-59ac-a957-4af067b8c292
                        
    [33] => c52e53f6-9668-db24-a7d2-4af0647e7035
                        
    [34] => 382a036b-7f95-00bd-c0b9-4af9984bf2c4
                        
    [35] => 3ae2485a-a35d-fb9b-3a26-4ad8dbb92bd4
                    

    And this:
    PHP Code:
    'PROSPECT_LIST' => 
      array (
        
    'width' => '15%',
        
    'label' => 'Lead Source',
        
    'default' => true,
        
    'customCode' => getLeadSource(),
      ), 
    But, ugh! It only calls getLeadSource once to bind it to the array, ugh!

  5. #5
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Lead relationship to ProspectList

    Smarty wont allow me to define custom functions using functions.getLeadSource.php in teh /plugins dir... hmm.

    Writing my own custom functions would make this a million times easier, why can't I do this?


    Writing "die('loaded')" into the custom template file shows it isn't even being loaded... wha?

    Full path is:
    crmdir\include\Smarty\plugins\function.sugar_getLe adSource.php

    PHP Code:
    <?php

    die("included");
    function 
    smarty_function_sugar_getLeadSource($params, &$smarty)
    {

    }
    ?>
    PHP Code:
    'PROSPECT_LIST' => 
      array (
        
    'width' => '15%',
        
    'label' => 'Lead Source',
        
    'default' => true,
        
    'customCode' => '{sugar_getLeadSource}',
      ), 
    Prints "{sugar_getLeadSource}" on the page.
    Last edited by wdroush; 2009-11-12 at 06:52 PM.

  6. #6
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Lead relationship to ProspectList

    Sigh, customCode doesn't even USE smarty.
    PHP Code:
    :{"width":"15%","label":"Lead Source","default":true,"customCode":"{$ID}"}}; 


    Edit:
    Wait... huh? That can't be it, I have javascript disabled, ugh this is confusing.


    From documentation:
    customCode n/a (empty) Override all HTML output and create your own. Accepts Smarty code.
    No, no it doesn't.
    Last edited by wdroush; 2009-11-12 at 08:04 PM.

  7. #7
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Lead relationship to ProspectList

    Bump, lead lists either need to support php code or should support proper smarty code.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add contact to prospectlist by SOAP
    By KISSsoft in forum Developer Help
    Replies: 0
    Last Post: 2009-03-05, 03:41 PM
  2. Lead Relationship
    By chetansharma05 in forum Developer Help
    Replies: 1
    Last Post: 2008-08-29, 09:38 AM
  3. Lead Relationship
    By chetansharma05 in forum Help
    Replies: 0
    Last Post: 2008-08-29, 07:01 AM
  4. ProspectList Subpanel
    By cbmarcos in forum Developer Help
    Replies: 2
    Last Post: 2008-08-11, 02:29 PM
  5. Problem Searching Leads by ProspectList
    By pgaustin in forum Help
    Replies: 0
    Last Post: 2006-09-15, 08:09 AM

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
  •