Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: relate two modules

  1. #1
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default relate two modules

    I'm using Sugar 5 and I've created 2 new modules using the module builder.
    Is there a way to relate the two modules together? When I go to flex relate or just relate, none of the new modules show up. How can I fix this?

  2. #2
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: relate two modules

    Create flex relate or relate w/, say, Accounts module.
    Then after you publish a package, just replace 'Accounts' labels in vardefs, metadata, layoutdefs of installation package w/ labels of your custom module.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  3. #3
    lucchase is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    12

    Default Re: relate two modules

    Superman, is it a reported bug then? And that is a work-around for the bug?

  4. #4
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default Re: relate two modules

    What I'd really like to do is to be able to write a piece of code that would add the new modules dynamically to the relate and flex relate drop down options. This way, whenever I add a new module, I could automatically relate it to an existing module regardless if it's a sugar module or custom module.

  5. #5
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: relate two modules

    Lucchase, I don't think it is a bug.

    Sacramentojoe, you may push such business logic into post_install script of new custom module. So, when it is being installed dropdown will be updated w/ your additions.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  6. #6
    xpojosh is offline Member
    Join Date
    May 2007
    Posts
    5

    Default Re: relate two modules

    Superman,

    I'm also trying to create a one-to-many relationship between 2 custom modules.

    I've tried following your advice to create a relate field with the Accounts module and then modifying the labels in the various files you listed. It didn't work out for me. I'm a bit of a newbie to PHP, so if you could include complete path names (and any other tips), that would be most appreciated. Thanks!

  7. #7
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: relate two modules

    Actually, Module Builder provides only many-to-many relationships.
    Therefore, you should go to SugarWiki and find doc on how to create one-to-many relationship

    Happy New Year!
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  8. #8
    RickM is offline Sugar Community Member
    Join Date
    Apr 2005
    Location
    Boca Raton, FL
    Posts
    220

    Default Re: relate two modules

    Quote Originally Posted by Superman
    Actually, Module Builder provides only many-to-many relationships.
    Therefore, you should go to SugarWiki and find doc on how to create one-to-many relationship

    Happy New Year!
    Superman - can you provide a link to the wiki document you mention above? I searched "one-to-many" and didn't get any hits in the wiki! Thanks!

    Rick

  9. #9
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: relate two modules

    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  10. #10
    wesblake is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    11

    Smile Re: relate two modules

    Hi. I am actually taking over the project that sacramentojoe was referring to. I have modified the ModuleBuilder to create a "post_install.php" script on publish/deploy/export and when I deploy a module it seems to be running it, however the code I'm putting into the post_install.php file does not seem to be correct. I need it to do as you said and update the dropdown values with the new module. Here's the current code being generated in post_install.php (I'm basing it off of diving through the code in ModuleBuilder that currently updates a dropdown from studio, but I may have some parameters incorrect or something):

    <?php
    require_once ('modules/ModuleBuilder/parsers/ParserFactory.php');
    $params = array();
    $params['action'] = 'savedropdown';
    $params['dropdown_lang'] = $GLOBALS['sugar_config']['default_language'];
    $params['dropdown_name'] = 'record_type_display';
    $params['module'] = 'ModuleBuilder';
    $params['view_package'] = 'studio';
    $tempModules = $GLOBALS['app_list_strings']['record_type_display'];
    $parser = ParserFactory::getParser('dropdown');
    $tempModules['test1_TestModuleP2'] = 'test1_TestModuleP2';
    $params['list_value'] = $tempModules;
    $parser->saveDropDown($params);
    ?>

    Any ideas? I got the $params using firebug to examine a post during the regular dropdown editor save process, so that could be off. What it's doing now is when this runs, it just adds the following to the end of the custom/include/language/en_us.lang.php file:

    $app_list_strings['']=array (
    );

    Any help is much appreciated!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Relationships / interdependencies between modules?
    By cyberdude in forum General Discussion
    Replies: 2
    Last Post: 2007-08-22, 07:23 AM
  2. Custom loadable modules relationships
    By mbarlow310 in forum Developer Help
    Replies: 1
    Last Post: 2007-07-02, 05:34 PM
  3. Replies: 2
    Last Post: 2006-02-19, 12:39 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
  •