<div dir="ltr"><div>Thank you both. Matus solution works for me.</div><div><br></div><div>Have a nice day.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun, 23 sept 2024 a las 2:24, Alan Lord (<<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <div>On 23/09/2024 04:26, Alexander Allen
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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>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">
      <div dir="ltr">
        <div> $recordModel=
          Vtiger_Record_<a>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 href="https://community.vtiger.com/help/vtigercrm/developers/server-apis.html" target="_blank">https://community.vtiger.com/help/vtigercrm/developers/server-apis.html</a></p>
    <p>HTH</p>
    <p>Al<br>
    </p>
    <br>
  </div>

_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>