Results 1 to 3 of 3

Thread: Display and search info from module b in module a.

  1. #1
    pixprotom is offline Sugar Community Member
    Join Date
    Nov 2009
    Posts
    36

    Default Display and search info from module b in module a.

    I have a custom field in the Accounts module (membership - yes or no). I need to show this membership field in the Contacts module and also be able to search for all contacts whose account is membership = yes.

    Are there any good clear instructions around that I can follow to get this to work? Or can someone guide me through this?

  2. #2
    raylcm is offline Junior Member
    Join Date
    Sep 2010
    Posts
    2

    Default Re: Display and search info from module b in module a.

    Hi, Is there anyone who can help reply this post? I have the same need and cannot find any ugrade-safe and workable solution after 2 days search

  3. #3
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Display and search info from module b in module a.

    Well if i got you right, you want to have contact assigned to account and if that account is membership = yes, you want to see that on contact also?

    I would do it with logic hooks by making a custom field in contacts module also named like membership and have it displayed on detailview only, but then i would make before_save logic hook which would do something like this:

    PHP Code:
    // find out if the account from contact has membership yes or no
    $query "SELECT membership FROM accounts WHERE id = '$bean->account_id'";
    $result $db->query($query,true);

    // fetch a row selected
    $row $db->fetchByAssoc($result);

    // assign account membership status to contact,  do log->fatal to see what array field to use
    $bean->membership $row['membership'];

    // now you will have membership status copied from account to contact, but you can also make
    // before_save logic_hook for account to update all contacts assigned membership status so you are 
    // allways up-to-date 
    CRM Software Engineer
    Eontek - www.eontek.rs

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 2010-12-06, 02:03 AM
  2. display and hide search form in a module
    By sugarcare in forum Developer Help
    Replies: 5
    Last Post: 2010-09-29, 06:12 AM
  3. Custom fields of one module in basic search of other module
    By asaya deepak in forum Developer Help
    Replies: 1
    Last Post: 2010-01-18, 11:48 PM
  4. Replies: 1
    Last Post: 2009-08-07, 10:38 AM
  5. adding additional info next to the module name
    By sugarcare in forum Developer Help
    Replies: 1
    Last Post: 2009-03-04, 10:42 AM

Tags for this Thread

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
  •