Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Sugar CRM using Rest API in Java

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sugar CRM using Rest API in Java

    Hi,
    any body implemented set operations using Sugar CRM Rest API..?


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Sugar CRM using Rest API in Java

    Welcome to the forum.

    Did you have a problem with some code you forgot to post?
    Thread moved from "Whats wrong with my code?"

    Please visit the Announcements page for a brief on forum usage, especially number 9.

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Sugar CRM using Rest API in Java

    Thanks for your reply
    actually, i wanted to set a relationship between 2 modules of SugarCRM using Rest API. Function name is set_relationship.
    here is the code sample

    /////Start Java Code

    SugarSession session = client.getSugarSession(new SugarCredentials("admin", "admin"));
    String moduleName="Accounts",linkFieldName="Contacts";
    //First set_entry()
    HashMap<String,String> values=new HashMap<String,String>();
    values.put("name","TESTsetRelation");
    String moduleId= client.setBean(session, moduleName,values);
    SugarBean moduleBean = client.getBean(session, moduleName, moduleId);
    assertEquals(moduleName, moduleBean.getModuleName());
    //Second set_entry()
    values=new HashMap<String,String>();
    values.put("first_name","TESTsetRelation");
    String relatedId= client.setBean(session, linkFieldName,values);
    SugarBean linkBean= client.getBean(session, linkFieldName, relatedId);
    assertEquals(linkFieldName, linkBean.getModuleName());

    SetRelationshipResponse response= (SetRelationshipResponse)client.setRelationship(se ssion, moduleName,moduleId,linkFieldName.toLowerCase(),re latedId);

    if (response.getFailed()==1){
    throw new Exception("Set Relationship failed.");
    }


    //////end java code

    it shows Created:1,Failed:0,Deleted:0.... as it must be. but the problem is that it doesn't make any relation.

  4. #4
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Sugar CRM using Rest API in Java

    I direct your attention to the link in my previous post, this time just read the whole page. Lets not make someone point out each number on the page.
    Wrap your code in tags, and make it easy for us to help you.

    Please be specific with the problem you are facing. "it doesn't make any relation" is not a very clear description of the problem. What does the code do? What do you expect?

Similar Threads

  1. Image storing through Rest Webservices in DB.
    By Surabhi16 in forum Java Theory & Questions
    Replies: 1
    Last Post: May 30th, 2013, 04:19 AM
  2. Rest client
    By skuskusas in forum Android Development
    Replies: 0
    Last Post: December 18th, 2012, 08:48 AM
  3. let first thread through, the rest has to wait
    By hamsterofdeath in forum Threads
    Replies: 0
    Last Post: November 19th, 2010, 01:32 PM
  4. Difference between Speech API and Sound API
    By zeeshanmirza in forum Java SE APIs
    Replies: 1
    Last Post: October 22nd, 2009, 01:22 AM
  5. Replies: 1
    Last Post: August 7th, 2008, 03:09 AM