CRM Open Source Business & Social CRM Software

Results 1 to 5 of 5

Thread: get_linked_beans where clause

  1. #1
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,409

    Default get_linked_beans where clause

    How do I use the where clause in get_linked_brans?

    I tried the following

    $where = 'ischeme' = 1';
    $jobs = $so->get_linked_beans('zz_so_zz_job_id','zz_job','','' ,'',0,$where);

    But I get the following sql error

    Query Failed:SELECT zz_job.id FROM zz_job WHERE zz_job.zz_so_id= '2ae503e5-d1be-7c95-74cc-48fee60192c1' AND zz_job.deleted=0 AND ii'i'::MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''i'' at line 1

    How should the where statement be written?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk

    Sugar version 5.5.1
    php version 5.2.6
    MySql 5.0.77

  2. #2
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: get_linked_beans where clause

    Hi Mike,

    Try this:

    $where = array(
    'lhs_field' => 'ischeme',
    'operator' => '=',
    'rhs_value' => '1',
    );


    I hope this help.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.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.

  3. #3
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,409

    Default Re: get_linked_beans where clause

    Quote Originally Posted by dlorenzetti
    Hi Mike,

    Try this:

    $where = array(
    'lhs_field' => 'ischeme',
    'operator' => '=',
    'rhs_value' => '1',
    );


    I hope this help.
    Diego thanks works perfectly

    is there a way I can do more than one condition?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk

    Sugar version 5.5.1
    php version 5.2.6
    MySql 5.0.77

  4. #4
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: get_linked_beans where clause

    Hi Mike,
    sorry to bother you but this forum is meant for Tutorials only.
    Please post in Help forum.
    What do you think the cookie monster eats ?

  5. #5
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,409

    Default Re: get_linked_beans where clause

    Quote Originally Posted by DragonflyMaster
    Hi Mike,
    sorry to bother you but this forum is meant for Tutorials only.
    Please post in Help forum.
    Yup sorry - posted here by mistake

    Could someone please move this thread to Developer help
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk

    Sugar version 5.5.1
    php version 5.2.6
    MySql 5.0.77

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple conditions act only as AND clause
    By publitas in forum Feature Requests
    Replies: 0
    Last Post: 2007-05-17, 01:17 PM
  2. Inserting an AND clause into the oportunity list
    By peterlbrown in forum Developer Help
    Replies: 4
    Last Post: 2007-02-20, 10:54 PM
  3. Replies: 0
    Last Post: 2006-03-29, 11:59 AM
  4. ORDER BY clause elusive
    By RemSoft in forum Developer Help
    Replies: 2
    Last Post: 2006-01-23, 08:10 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
  •