Results 1 to 7 of 7

Thread: Get Linked Beans In Custom Module DetailView

  1. #1
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Get Linked Beans In Custom Module DetailView

    Ok i've been searching for an answer all day on this. Was hoping someone on here could help me figure it out.

    I've created a custom button within detailviewdefs.php ... the button requires the ID from the related module... right now i have

    Code:
    $account = new ab12_Company_PO_Vendor_Invoices();
    $account->retrieve($_REQUEST['record']);
    $contacts = $account->get_linked_beans('opportunities','Opportunity');
    but it keeps returning

    Code:
    Undefined property: ab12_Company_PO_Vendor_Invoices::$opportunities 
    Call to a member function getBeans() on a non-object in
    any and all help would be appreciated... thank you

  2. #2
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Get Linked Beans In Custom Module DetailView

    It does not find "opportunities" in your module "ab12_Company_PO_Vendor_Invoices". Maybe the spelling of "opportunities" is wrong, e.g. capital "O" needed?
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  3. #3
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Get Linked Beans In Custom Module DetailView

    Tried

    Code:
    $contacts = $account->get_linked_beans('Opportunities','Opportunity');
    and got error

    Code:
    Notice: Undefined property: ab12_Company_PO_Vendor_Invoices::$Opportunities in
    is it because im trying to call all of this stuff from within a custom detailviewdefs.php file? or should that not matter?

  4. #4
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Get Linked Beans In Custom Module DetailView

    ok it worked but i had to do it this way

    Code:
    $contacts = $account->get_linked_beans('ab12_company_po_vendor_invoices_opportunities','Opportunity');

  5. #5
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Exclamation Re: Get Linked Beans In Custom Module DetailView

    URGENT!! new problem with getting relationships

    when i use
    Code:
    $originalObj = new Case();
    i get this error

    Code:
    Parse error: syntax error, unexpected T_CASE, expecting T_STRING or T_VARIABLE or '$' in /custom/modules/Cases/metadata/detailviewdefs.php on line 3
    please help thank you... i tried new Case() & new Cases() neither seem to work
    Last edited by banning; 2011-09-02 at 03:31 PM.

  6. #6
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Get Linked Beans In Custom Module DetailView

    The bean of Cases module is aCase instead.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  7. #7
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Get Linked Beans In Custom Module DetailView

    Linked beans can also be get from follow exemple code:
    PHP Code:
                $campaign_focus->load_relationship('prospectlists');
                
    $existing_pls $campaign_focus->prospectlists->get(); 
                
    //for each list returned, add the list to the relationship
                
    foreach($pl_list as $pl){
                     echo 
    $pl->id
                } 
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 2010-09-16, 01:57 PM
  2. Replies: 1
    Last Post: 2010-04-08, 03:10 AM
  3. Replies: 0
    Last Post: 2010-03-04, 09:42 AM
  4. linked field in subpanel for a custom module
    By itsteveg in forum Developer Help
    Replies: 4
    Last Post: 2009-01-20, 05:59 PM
  5. get linked beans
    By mikesolomon in forum Developer Help
    Replies: 0
    Last Post: 2008-10-22, 01:55 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
  •