<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 23/09/2024 04:26, Alexander Allen
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFpJncSh6H8eexwybBVZuyu=11EOhNuyNNF3XMkx1Uznue7T-g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hello, I want to update a quotestage from a quote but when
I do it via webservice all the products in the quote
disappear. I tried also to get all the products via webservice
but I only get the last product. Can you give me an idea how
can I achieve this?</div>
<div><br>
</div>
<div>My code looks like this:</div>
<div><br>
</div>
<div><?php<br>
</div>
<div>include_once 'include/Webservices/Utils.php';<br>
require_once('includes/main/WebUI.php');<br>
include_once 'include/Webservices/ModuleTypes.php';<br>
include_once 'include/Webservices/Query.php';<br>
<br>
$current_user = <a class="moz-txt-link-freetext" href="CRMEntity::getInstance('Users')">CRMEntity::getInstance('Users')</a>;<br>
$current_user->retrieveCurrentUserInfoFromFile(1);<br>
include_once 'include/Webservices/Create.php';</div>
<div> $linkModule ="Quotes";<br>
</div>
</div>
</blockquote>
<p>But using a Record Model isn't using Webservices?</p>
<blockquote type="cite"
cite="mid:CAFpJncSh6H8eexwybBVZuyu=11EOhNuyNNF3XMkx1Uznue7T-g@mail.gmail.com">
<div dir="ltr">
<div> $recordModel=
Vtiger_Record_<a class="moz-txt-link-freetext" href="Model::getInstanceById($newId,$linkModule)">Model::getInstanceById($newId,$linkModule)</a>;<br>
$recordModel->set('mode','edit');<br>
$recordModel->set('quotestage', 'SENT'); <br>
</div>
<div>$recordModel->save();</div>
<div><br>
</div>
</div>
</blockquote>
<p>Try actually using the "revise" server API perhaps?<br>
<br>
<span style="white-space: pre-wrap; display: block; width: 98vw;">> include_once 'include/Webservices/Revise.php';
> try {
> $wsid = vtws_getWebserviceEntityId('Leads', 'CRMID') // Module_Webservice_ID x CRM_ID
> $data = array('firstname' => 'FIRSTNAME', 'id' => $wsid);
> $lead = vtws_revise($data, $current_user);
> print_r($lead);
>
> } catch (WebServiceException $ex) {
> echo $ex->getMessage();
> }
</span><a class="moz-txt-link-freetext" href="https://community.vtiger.com/help/vtigercrm/developers/server-apis.html">https://community.vtiger.com/help/vtigercrm/developers/server-apis.html</a></p>
<p>HTH</p>
<p>Al<br>
</p>
<br>
</body>
</html>