Results 1 to 6 of 6

Thread: SOAP API - get_entry_list to retrieve cases for a contact

  1. #1
    herman_munster is offline Junior Member
    Join Date
    May 2006
    Posts
    4

    Default SOAP API - get_entry_list to retrieve cases for a contact

    Hi All

    I am trying to use the get_entry_list SOAP API call to retrieve Cases that are related to a Contact. I hope to pass in a contact id as part of the query, but I cannot see how to construct this query.

    The relationships are understandable, and I have these setup OK.
    1. contacts.id -> contacts_cases.contact_id
    2. contacts_cases.case_id -> cases.id

    My problem is, what query do I send to the get_entry_list method to retrieve Cases that belong to a Contact?

    Or am I using the wrong call for this altogether?
    Last edited by herman_munster; 2006-06-07 at 03:58 AM.

  2. #2
    herman_munster is offline Junior Member
    Join Date
    May 2006
    Posts
    4

    Default Solved - SOAP API - get_entry_list to retrieve cases for a contact

    Hi All

    Solved

    Query to send in to get_entry_list was "cases.id in (select case_id from contacts_cases where contact_id = 'contact-id')"

    Seems to work OK.

  3. #3
    sugarcare is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    405

    Default Re: SOAP API - get_entry_list to retrieve cases for a contact

    amazing both of us are trying to do the samething on the same day.

    It doesn't work for me. Could you please provide me the full API call and the values. I may be missing something. I am also trying to retrieving the name, description field of the case. It would be great if you can get the query. I greatly appreciate your help.
    Last edited by sugarcare; 2006-06-05 at 09:49 PM.

  4. #4
    herman_munster is offline Junior Member
    Join Date
    May 2006
    Posts
    4

    Default Re: SOAP API - get_entry_list to retrieve cases for a contact

    Hi

    It is a bit of a coincidence

    The SOAP parameters I passed are as follows:

    module_name : Cases
    query : cases.id in (select case_id from contacts_cases where contact_id = 'contactId')
    order_by : cases.date_modified desc
    offset : 0
    fields : new String[] {"id", "case_number", "name"}
    max_results : 20
    deleted : false

    Note that contactId in the query is the id of the contact you are retrieving cases for

    Hope this helps out!

  5. #5
    sugarcare is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    405

    Default Re: SOAP API - get_entry_list to retrieve cases for a contact

    Thanks a lot. Actually I figured it by myself. But I saw you using string for the fields.

  6. #6
    pgiuseppe is offline Sugar Community Member
    Join Date
    Feb 2005
    Posts
    58

    Lightbulb how to: select with SOAP all the contacts in a project

    with this C# code you can select all the contacts that related to a Project

    Code:
    		  
     string Project Id = "d4dc101c-103c-0b41-0ae7-45096ccc352d";
     string[] selectFields ={ "id", "last_name", "first_name"};
      
        string Contactsquery = "contacts.id IN   ( select project_relation.relation_id FROM  project_relation WHERE  project_relation.project_id = '"+Project Id +"')";
      			string ContactOrder = "contacts.last_name";

Thread Information

Users Browsing this Thread

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

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
  •