oracle - adding CustomerSalesTeam in customer in netsuite PHPToolkit -
oracle - adding CustomerSalesTeam in customer in netsuite PHPToolkit -
when seek add together customersalesteam in client in netsuite via php code. gives me error
fatal error: uncaught soapfault exception: [soapenv:server.userexception] org.xml.sax.saxexception: salesteam on {urn:relationships_2013_1.lists.webservices.netsuite.com}customersalesteamlist must of type {urn:relationships_2013_1.lists.webservices.netsuite.com}customersalesteam in c:\wamp\www\ns\phptoolkit\nsphpclient.php:287 stack trace: #0 c:\wamp\www\ns\phptoolkit\nsphpclient.php(287): soapclient->__soapcall('add', array, null, array) #1 c:\wamp\www\ns\phptoolkit\netsuiteservice.php(118604): nsphpclient->makesoapcall('add', object(addrequest)) #2 c:\wamp\www\ns\samples\add_customer.php(38): netsuiteservice->add(object(addrequest)) #3 {main} thrown in c:\wamp\www\ns\phptoolkit\nsphpclient.php on line 287
and client adding code : require_once '../phptoolkit/netsuiteservice.php'; $service = new netsuiteservice(); $customer = new customer(); $customer->lastname = "sale"; $customer->firstname = "rep"; $customer->companyname = "sale rep testing"; $customer->phone = "123456789"; $cst=new customersalesteam(); //$c=new customersalesteam(); //$em=new recordref(); //$em->internalid='1333083'; //$cst->employee=$em; $cst->employee->internalid="1372"; $cst->salesrole->internalid="1"; $cst->isprimary=true; $cst->contribution=10.4; $cstl=new customersalesteamlist(); $cstl->replaceall=true; //$cstl->salesteam[]=$cst; $cstl->salesteam =array($cst); //$cstl->salesteam=$cst; $customer->salesteamlist=$cstl; //$salesrep=new recordref(); //$salesrep->internalid='2792'; //$customer->salesrep=$salesrep; $request = new addrequest(); $request->record = $customer; //$service->update($arg) $addresponse = $service->add($request); if (!$addresponse->writeresponse->status->issuccess) { echo "add error"; print_r($addresponse->writeresponse); } else { echo "add success, id " . $addresponse->writeresponse->baseref->internalid; }
you should have added internal id of sales team have created in setup > sales > sales teams , not fellow member of sales team.
i not in php assume work.
$cst=new customersalesteam(); $cst->salesteamlist->internalid= idofyoursalesteam;
oracle magento netsuite
Comments
Post a Comment