Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: SugarCRM + SOAP + ColdFusion + Bug Tracker

  1. #1
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default SugarCRM + SOAP + ColdFusion + Bug Tracker

    OS >> Windows
    Sugar >> Version 4.5.1b
    Webserver >> Windows IIS
    PHP >> 4.3.11
    MySQL >> 5.0.37

    This is my first post on the SugarCRM Forums, but it is definitely not the first time I have been helped by the information provided here. Thanks in advance for your help.


    I have developed a ColdFusion webservice SOAP call to the SugarCRM Bug Tracker module. This form works well and adequately submits to our SugarCRM. My issue has been with retrieving the available tickets and how my queries should be structured.

    I am also having issues accessing the nested Methods that are returned to me. Here is my experience...

    This is my code to Get my open Tickets from the Bug Tracker:
    Code:
    <cfset wsURL = "http://sugar.########.com/soap.php?wsdl">
    
    <!--- Login to sugar.#######.com --->
    <cfscript>
    	hashPass = Hash("########", "MD5");
    	
    	user_auth = StructNew();
    		StructInsert(user_auth, "user_name", "########");
    		StructInsert(user_auth, "password", hashPass);
    		StructInsert(user_auth, "version", "1.2");
    </cfscript>
    
    <cfinvoke webservice="#wsURL#" method="login" returnvariable="loginresult">
    	<cfinvokeargument name="user_auth" value="#user_auth#">
    	<cfinvokeargument name="application_name" value="Test app">
    </cfinvoke>
    
    <!--- Get open tickets --->
    <cfscript>		
    	select_fields = ["bugs.status", "bugs.client_c", "bugs.name", "bugs.description"];
    </cfscript>
    
    
    <cfinvoke webservice="#wsURL#" method="get_entry_list" returnvariable="openbugs">
    	<cfinvokeargument name="session" value="#loginresult.getId()#">
    	<cfinvokeargument name="module_name" value="Bugs">
    	<cfinvokeargument name="query" value="">
    	<cfinvokeargument name="order_by" value="bugs.status">
    	<cfinvokeargument name="select_fields" value="#select_fields#">
    	<cfinvokeargument name="max_results" value="0">
    	<cfinvokeargument name="offset" value="0">
    	<cfinvokeargument name="deleted" value="0">
    </cfinvoke>
    
    <cfoutput><cfdump var="#openbugs#"></cfoutput>
    This is the response I get back from Sugar:



    When I change the output variable from (referencing a specific method):
    Code:
    <cfoutput><cfdump var="#openbugs#"></cfoutput>
    to
    Code:
    <cfoutput><cfdump var="#openbugs.getEntry_list()#"></cfoutput>
    Calling the method of the return variable (above) gives me the following return:


    The issue I am having is accessing the nested Methods inside of the array I am getting back from the second SugarCRM return. I have had trouble finding any documentation that will help me with this. In fact, everything I'm reading doesn't show getting back these objects but shows a Structure with what I want back from the webservice, i.e. the open Bug Tickets.

    Sorry if this is confusing, but any help is very much appreciated. If you have any questions or would like me to clarify further I well do my best.

    Thanks,
    Chris

  2. #2
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Any similar experience interacting with these returned Methods with other languages could be of major help to...

    Has anyone seen return objects like the images posted above? Any ideas how to get to the methods within the methods?

    Thanks in advance.

  3. #3
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Well... I suppose I'm up a creak on this one.

  4. #4
    Join Date
    Feb 2007
    Location
    San Jose, CA
    Posts
    1,169

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Hi there,


    I'll have Julian (from the Online team at Sugar) take a look at this... we have been slammed the last few days with a major project, but should have some time today as things settle down...
    Susie Williams

  5. #5
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Thanks alot. Sorry for my lack of patience.

  6. #6
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Ouch... page 2 and no reply... no help on the Adobe ColdFusion forum either.

    I thought was supposed to help different systems talk to each other!

  7. #7
    chrisborah is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Any chance Julian has had and/or will have a chance to look at this one?

    Am I SOL trying to use ColfFusion with Sugar?

  8. #8
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Hello chrisborah,

    I've never used ColdFusion myself, but I wonder-- do you have any trouble connecting to other webservices? I'm curious to see if this problem is specific to Sugar or not.

    Also, is it possible to dump the raw XML response that Sugar sends back to you? If so, please post it here.

    Thanks!
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  9. #9
    goldglovecb is offline Junior Member
    Join Date
    Dec 2007
    Posts
    1

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    In case anyone else comes across this post looking for an answer, there is a pretty simple way to get values from nested functions using CF. In this case, create a blank array as a placeholder. Then loop through the array that Sugar returned, executing whichever nested function will return the value you're looking for. The result is appended to the new placeholder array.

    For example:

    Code:
    <cfset myArray = ArrayNew(1)>
    <cfest crmArray = openbugs.getEntry_list()>
    <cfloop from="1" to="#arraylen(crmArray)#" step="1" index="index">
    
    <cfset ArrayAppend(myArray,crmArray[index].myNestedFunction())>
    </cfloop> <cfdump var="#myArray#">
    The real challenge is finding a nested function that will return simple object values that a person can understand. In the eyes of ColdFusion/Java, Sugar sends/receives complex objects. CF is smart enough to pick up the entire object. Since the Sugar SOAP docs don't list what these sub-functions do (from a non-tech perspective), it is sometimes a trial-and-error effort to find the function that results in what you want. Pay attention to the Return Types displayed by the CFDUMP tag. You can usually find what you're looking for quickly by scanning for simple object types like String, int, boolean, etc.

    Hope this helps some people.

  10. #10
    Join Date
    Aug 2008
    Posts
    14

    Default Re: SugarCRM + SOAP + ColdFusion + Bug Tracker

    Hi,

    This is really a question about your example.

    I want to use the get_entry_list method and am passing a select_fields parameter to the contacts object.

    Your syntax is:
    <!--- Get open tickets --->
    <cfscript>
    select_fields = ["bugs.status", "bugs.client_c", "bugs.name", "bugs.description"];
    </cfscript>

    But I get a CF parser error when I try
    <cfscript>
    select_fields = ["contacts.first_name", "contacts.last_name"];
    </cfscript>

    ie
    Invalid CFML construct found on line 33 at column 25.
    ColdFusion was looking at the following text:

    [

    How did you get your syntax to work?

    Thanks,
    Murray

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 2006-10-26, 01:13 PM
  2. Replies: 61
    Last Post: 2006-10-22, 08:40 AM
  3. Status of Bug Tracker
    By tpletcher in forum General Discussion
    Replies: 4
    Last Post: 2005-08-31, 06:23 PM
  4. Task - Bug Tracker
    By rana in forum Developer Help
    Replies: 0
    Last Post: 2005-07-26, 08:49 AM
  5. SOAP to SugarCRM using PEAR SOAP?
    By ryaker in forum General Discussion
    Replies: 0
    Last Post: 2005-04-12, 07:23 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
  •