Sugar 5.2.0k
I am wanting to get a certain ID to display in SOAP, and show information for just that ID. Would also like to be able to update that ID's information through SOAP. any help/tutorials? I'm working with the SoapTest.php files
thanks
Sugar 5.2.0k
I am wanting to get a certain ID to display in SOAP, and show information for just that ID. Would also like to be able to update that ID's information through SOAP. any help/tutorials? I'm working with the SoapTest.php files
thanks
Take a look at the Dev Guide and Developers site (http://developers.sugarcrm.com)
In a nutshell, you can retrieve data using the method get_entry_list()
That'll give you the ID values of the records that meet your criteria. To update the record, use the set_entry() method, passing the specific ID of the record to be updated as one of the values.
Regards,
Angel Magaņa
Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
Blog: http://cheleguanaco.blogspot.com.
Twitter: @cheleguanaco.
________
| Projects: |_____________________________________
|
| CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
| GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
| CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
| Round Robin Leads Assignment
| Phone Number Formatter
| CaseTwit (Twitter Integration)
______________________________________________
I'm not having any luck. Basically I want to show a Customer Number in a custom module called Customers.
When I load the page it's blank.
I have it in my examples directory
I think the error is in this line,PHP Code:<?php
require_once("../include/nusoap/nusoap.php");
class SugarSoap{
var $proxy;
var $sess;
function SugarSoap($soap_url,$login=true){
$soapclient = new soapclient($soap_url,true);
$this->proxy = $soapclient->getProxy();
if($login) $this->login();
}
}
function login(){
$params = array(
'user_name' => 'admin',
'password' => md5('MYpass'),
'version' => '.01'
);
$result = $this->proxy->login($params,'MyApp');
$this->sess= $result['error']['number']==0 ? $result['id'] : null;
return $this->sess;
}
function get LIN_Customer($query='',$maxnum=0,$orderby=' LIN_Customer.lname asc'){
$result = $this->proxy->get_entry_list(
$this->sess,
'Customers',
$query,
$orderby,
0,
array(
'cust_no',
'fname',
'lname',
'co_name',
),
$maxnum,
false
);
return $result;
}
?>It is actually suppose to be, getLIN_Customer($.... right? but still don't get results for that.PHP Code:function get LIN_Customer($query='',$maxnum=0,$orderby=' LIN_Customer.lname asc'){
Last edited by Dustin09; 2010-01-20 at 04:09 PM.
At these sticking points I usually start entering a bunch of debug code such as echo "here 1"; etc to find out where it's failing. Outputting variable values helps a ton as well.
Co-Founder of: SugarOutfitters
Modules:
SecuritySuite (Teams)
Photo Module
Follow me on Twitter:eggsurplus
Your Personal Developer
lol, That's how I knew which line was screwing up.
Looks like the function name has a space in it: get LIN_Customer. Try renaming to something else like get_LIN_Customer. Then you'll need to call that function at some point to kick it off.
Co-Founder of: SugarOutfitters
Modules:
SecuritySuite (Teams)
Photo Module
Follow me on Twitter:eggsurplus
Your Personal Developer
This displays, HELLO HELLO 2 HELLO3. So it seems to be okay. Is there not an easier way to work with SOAP/PHP ? I don't know what the hell I'm doing.
PHP Code:<?php
echo "HELLO";
require_once("../include/nusoap/nusoap.php");
class SugarSoap{
var $proxy;
var $sess;
function SugarSoap($soap_url,$login=true){
$soapclient = new soapclient($soap_url,true);
$this->proxy = $soapclient->getProxy();
if($login) $this->login();
}
}
function login(){
$params = array(
'user_name' => 'admin',
'password' => md5('MYpass'),
'version' => '.01'
);
$result = $this->proxy->login($params,'MyApp');
$this->sess= $result['error']['number']==0 ? $result['id'] : null;
return $this->sess;
}
echo " HELLO 2";
function getLIN_Customer($query='',$maxnum=0,$orderby=' LIN_Customer.lname asc'){
$result = $this->proxy->get_entry_list(
$this->sess,
'Customers',
$query,
$orderby,
0,
array(
'cust_no',
'fname',
'lname',
'co_name',
),
$maxnum,
false
);
return $result;
}
echo " HELLO3";
?>
Looks fine. You need to actually call the function though at some point. Such as after your hello3 do this:
getLIN_Customer();
This will get you inside your function. You'll need to do more work to get it to do what you want though.
Co-Founder of: SugarOutfitters
Modules:
SecuritySuite (Teams)
Photo Module
Follow me on Twitter:eggsurplus
Your Personal Developer
Well thank you very much. There is nothing put together by anyone to do this easier by chance?
hi
im trying to do the same sort of thing, any luck on finding any examples / do you have code you could share with the community a i think it would be really useful!?
thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks