Results 1 to 9 of 9

Thread: Adding Relationship from Custom Person Template to Target List

  1. #1
    donaldthomps is offline Junior Member
    Join Date
    Sep 2009
    Posts
    4

    Smile Adding Relationship from Custom Person Template to Target List

    Hi,

    I've created a custom module based on the "Person" template, let's call it "Partners" for the sake of this post. However, now I want to include the people I add to this module in a Target List.

    I cannot see in Module Builder or in Studio how to create a relation between Partners and Target Lists. However, when I look at the relationships for the standard Contact module I cannot see a physical relationship between Contacts and Target Lists.

    So, any ideas on how I can achieve this?

  2. #2
    jry
    jry is offline Senior Member
    Join Date
    May 2009
    Posts
    29

    Default Re: Adding Relationship from Custom Person Template to Target List

    Basically this is not possible without heavy coding changes.

    See here:
    http://www.sugarcrm.com/forums/showthread.php?t=51652

  3. #3
    jstolle is offline Member
    Join Date
    Aug 2010
    Posts
    12

    Default Re: Adding Relationship from Custom Person Template to Target List

    Quote Originally Posted by donaldthomps View Post
    So, any ideas on how I can achieve this?
    I have the same question. I'm considering going through all the PHP files to do the heavy code modifying to figure this out. I was wondering if you were able to do the code changes to make it work or did you go a different route?

  4. #4
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Smile Re: Adding Relationship from Custom Person Template to Target List

    Quote Originally Posted by donaldthomps View Post
    Hi,

    I've created a custom module based on the "Person" template, let's call it "Partners" for the sake of this post. However, now I want to include the people I add to this module in a Target List.

    I cannot see in Module Builder or in Studio how to create a relation between Partners and Target Lists. However, when I look at the relationships for the standard Contact module I cannot see a physical relationship between Contacts and Target Lists.



    Hi ,


    Try this

    1) save a empty file studio.php in modules/ProspectList/metadata directory ,
    2) goto admin -> Studio -> here you will get Target list
    3) add relationship between target list and your custom modules , then repair relationship

    Regards
    Shailendra
    Last edited by shailendra001; 2010-08-25 at 08:05 AM.

  5. #5
    jstolle is offline Member
    Join Date
    Aug 2010
    Posts
    12

    Default Re: Adding Relationship from Custom Person Template to Target List

    Quote Originally Posted by shailendra001 View Post
    Try this

    1) save a file studio.php in modules/ProspectList/metadata directory save ,you may copy studio.php from any default modules(like Accounts/metadata) and make it blank
    2) goto admin -> Studio -> here you will get Target list
    3) add relationship between target list and your custom modules , then repair relationship
    Shailendra, I have a custom module I created called "Members". It is just a module of type "person" with no extra customization so far.

    Your suggestion looked very promising when I tried it, but it doesn't work the way I need it to. It does let me create a relationship from my Members to Target Lists, but when I try to send a test email with a Campaign that includes Members, no emails get sent. The Target List also says 0 entries (see screenshot).



    Let me clarify what I did:
    1. Made a copy of /modules/Contacts/metadata/studio.php and placed it in /modules/ProspectLists/metadata/ (clearing out everything after the comments in the file)
    2. Navigated to the Admin>Studio page and find that "Target Lists" is now available to edit.
    3. Add a Many to Many relationship from Target Lists to my custom module.
    4. Ran the Repair>Rebuild Relationships function


    If I look in the tables, I find that the relationship isn't stored in "prospect_lists_prospects", but rather in "prospectlis_jcs_members_c". Your suggestion feels so very close to the solution. I hope you can help me figure out the final piece of the puzzle.

  6. #6
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Smile Re: Adding Relationship from Custom Person Template to Target List

    Hi !


    Please do it on some test instance ,
    what i did for this is here

    i added one array in
    my custom modules is oss_Person
    metadata/prospect_lists_prospectsMetaData.php

    Code:
    			
        'prospect_lists_oss_person' =>  array (
          'lhs_module' => 'ProspectLists',
          'lhs_table' => 'prospect_lists',
          'lhs_key' => 'id',
          'rhs_module' => 'oss_Person',
          'rhs_table' => 'oss_person',
          'rhs_key' => 'id',
          'relationship_type' => 'many-to-many',
          'join_table' => 'prospect_lists_prospects',
          'join_key_lhs' => 'prospect_list_id',
          'join_key_rhs' => 'related_id',
          'relationship_role_column'=>'related_type',
          'relationship_role_column_value'=>'oss_Person',
    	)

    and in modules/ProspectList/vardef.php

    i added one array

    Code:
    'oss_person' =>
      			array (
      			'name' => 'oss_person',
        		'type' => 'link',
        		'relationship' => 'prospect_lists_oss_person',
        		'source'=>'non-db',
      		),
    repair relationship
    Now you can check count at list view page is coming fine and , now you can check prospect_lists_prospects there will be entry

    check it with campaign , then let me know the result ,
    Last edited by shailendra001; 2010-08-25 at 02:03 PM.

  7. #7
    jstolle is offline Member
    Join Date
    Aug 2010
    Posts
    12

    Default Re: Adding Relationship from Custom Person Template to Target List

    Quote Originally Posted by shailendra001 View Post
    check it with campaign , then let me know the result
    Now we're getting there! The entry count is correct when I add people to the target list. I can send a test email--and it does get sent--but I get the following error on the screen after doing so:

    Fatal error: Cannot access empty property in /modules/EmailMan/EmailMan.php on line 466
    jry talks about it briefly in this thread. I think there are possibly several places that changes need to be made.

  8. #8
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Default Re: Adding Relationship from Custom Person Template to Target List

    Hi ,

    You are correct , in EmailMan.php everything is hard coded . but this is doable , depends on your interest and requirement , I am looking into it

    Keep trying your own and let me know if you get any solution ... i will do the same

    Regards
    Shailendra

  9. #9
    jstolle is offline Member
    Join Date
    Aug 2010
    Posts
    12

    Default Re: Adding Relationship from Custom Person Template to Target List

    Quote Originally Posted by shailendra001 View Post
    You are correct , in EmailMan.php everything is hard coded . but this is doable , depends on your interest and requirement
    I'm sure it is doable, but only through modifying core functions that would prevent a clean path for future updates. In my case, that's too much of a trade-off. I'm just starting out with SugarCRM and it seemed like this would be simpler given all the customization it allows.

    My goal was to simply have a different type of "Contact", namely "Members" that would have some additional fields that regular Contacts wouldn't, and could be managed separately for email campaigns.

    I can accomplish similar results by creating a custom "Contact Type" field. I would just have to ignore the extra Member fields that I'll be creating when editing non-Members.

    Thank you for your help thus far, Shailendra. Good luck if you continue to pursue it. I am still interested to see how far you get with it. Maybe it could be merged into the official build eventually.

    Thank you,
    Justin

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding all contacts to target list
    By parchambault in forum Feature Requests
    Replies: 24
    Last Post: 2010-07-16, 05:23 AM
  2. Adding to a Target List after a mailing
    By technogenii in forum Help
    Replies: 1
    Last Post: 2009-02-11, 08:16 PM
  3. Adding account to target list.
    By Lythande in forum Help
    Replies: 3
    Last Post: 2009-02-10, 07:21 PM
  4. Bug in adding Targets -> Target List
    By bkbonner in forum Help
    Replies: 1
    Last Post: 2006-02-01, 06:41 PM
  5. adding leads to target list
    By johnsam in forum Help
    Replies: 0
    Last Post: 2006-01-15, 10:36 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
  •