[Vtigercrm-developers] Editing Inventory related module via webservice
Alan Lord
alanslists at gmail.com
Mon Sep 23 08:18:43 GMT 2024
On 23/09/2024 04:26, Alexander Allen wrote:
> 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?
>
> My code looks like this:
>
> <?php
> include_once 'include/Webservices/Utils.php';
> require_once('includes/main/WebUI.php');
> include_once 'include/Webservices/ModuleTypes.php';
> include_once 'include/Webservices/Query.php';
>
> $current_user = CRMEntity::getInstance('Users');
> $current_user->retrieveCurrentUserInfoFromFile(1);
> include_once 'include/Webservices/Create.php';
> $linkModule ="Quotes";
But using a Record Model isn't using Webservices?
> $recordModel= Vtiger_Record_Model::getInstanceById($newId,$linkModule);
> $recordModel->set('mode','edit');
> $recordModel->set('quotestage', 'SENT');
> $recordModel->save();
>
Try actually using the "revise" server API perhaps?
> 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(); > }
https://community.vtiger.com/help/vtigercrm/developers/server-apis.html
HTH
Al
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20240923/ee36b79b/attachment.html>
More information about the vtigercrm-developers
mailing list