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:
This is the response I get back from Sugar: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>
When I change the output variable from (referencing a specific method):
toCode:<cfoutput><cfdump var="#openbugs#"></cfoutput>
Calling the method of the return variable (above) gives me the following return:Code:<cfoutput><cfdump var="#openbugs.getEntry_list()#"></cfoutput>
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


LinkBack URL
About LinkBacks





Reply With Quote

Bookmarks