Results 1 to 5 of 5

Thread: Subpanel doesn't link to parent record

  1. #1
    jmugauri is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Lusaka, Zambia
    Posts
    29

    Question Subpanel doesn't link to parent record

    Hi, again

    I've successfully managed to make my custom subpanel (AccountSLAs) show in the Accounts detail view. Thing is, my 'quick create' and 'full form' in the subpanel do not automatically populate the related fields from the parent Accounts view (i.e. populate akkn_account and sla_account_name with accounts.id and accounts.name, respectively). I have, thus far, done the following:

    1. Edited layout_defs.php and vardefs.php in the Accounts module to account for the relationship
    2. Likewise, edited vardefs.php in AccountSLAs module
    3. edited AccountSLA.php (bean file) to extend fill_in_additional_detail_fields() thus:

    $query = "SELECT acc.id, acc.name FROM accounts AS acc, accountslas AS acc_sla WHERE acc.id=acc_sla.akkn_account AND acc_sla.id='$this->id' AND acc.dele\
    ted=0";
    $result = $this->db->query($query, true, "Error filling in additional detail fields");
    $row = $this->db->fetchByAssoc($result);
    if ($row != null) {
    $this->sla_account_name = $row['name'];
    $this->akkn_account = $row['id'];
    } else {
    $this->sla_account_name = '';
    $this->akkn_account = '';
    }

    What am I missing?
    JamesTM

    OS: CentOS 5.2
    Sugar: 5.1
    Apache 2.2
    PHP 5.1
    MySQL 5

  2. #2
    gunni is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Cologne, Germany
    Posts
    364

    Default Re: Subpanel doesn't link to parent record

    Dont you think one thread is enough?

  3. #3
    jmugauri is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Lusaka, Zambia
    Posts
    29

    Default Re: Subpanel doesn't link to parent record

    Suppose it would be under normal circumstances. I encourage anyone who can to delete the post in the developers' forum.

    However, more to the point, Do u actually know anything I can do, or are you more concerned with forum politics? I forsook niceties when i realised at least one of the scores who read my post could provide valuable insight in a line or two, if they cared to, but obviously can't be bothered to do anything but (as you've demonstrated) moan about the (im)propriety of my methods without empathy.

    Here's the appropriate context... am desperately in need of a hand from anyone who has a clue. A link to a comprehensive subpanel how-to (not the insufficient ones in the Sugar Docs or the wiki) would be a reasonable start, don't you think?
    JamesTM

    OS: CentOS 5.2
    Sugar: 5.1
    Apache 2.2
    PHP 5.1
    MySQL 5

  4. #4
    gunni is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Cologne, Germany
    Posts
    364

    Default Re: Subpanel doesn't link to parent record

    Sorry i forgot to mention, that i am not able to help with your problem.
    If a solution comes to my mind i will post it here.

  5. #5
    jmugauri is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Lusaka, Zambia
    Posts
    29

    Thumbs up Sorted!!: Subpanel doesn't link to parent record

    Finally sorted, people!

    For any who may run into similar problems, ensure you custom module vardefs.php defines both an id and name field with the correct array fields and field type (i.e. link/relate as required)...

    Then ensure your custom bean has all required fields defined in the get_list_view_data function. Use existing modules e.g. Cases as a reference

    Otherwise, follow the instructions in this post.

    Good luck!!
    Last edited by jmugauri; 2007-09-24 at 01:40 PM. Reason: correction
    JamesTM

    OS: CentOS 5.2
    Sugar: 5.1
    Apache 2.2
    PHP 5.1
    MySQL 5

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Subpanel Export Link
    By gneill794 in forum Developer Help
    Replies: 21
    Last Post: 2008-08-05, 05:26 AM
  2. Can dashlet link go to Contact record?
    By leenwebb in forum Developer Help
    Replies: 3
    Last Post: 2008-01-29, 07:38 PM
  3. Merge Contacts show sql error
    By hheckner in forum General Discussion
    Replies: 5
    Last Post: 2006-10-04, 01:57 PM
  4. how to add a custom link to a subpanel field
    By tooth_decay in forum Developer Help
    Replies: 3
    Last Post: 2005-12-06, 09:00 PM
  5. Detail View Record ID in a Subpanel Popup
    By baba_2002 in forum Developer Help
    Replies: 0
    Last Post: 2005-11-04, 02:22 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
  •