[Vtigercrm-developers] how to get deleted records via webservice

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Vtigercrm-developers] how to get deleted records via webservice

lounik

Hi,

I have an external php script who programmatically check a vtiger 6.4. In order to do so, I've used the vtwsclib library. Now I need to get the records that have been deleted in the crm (records which have deleted = 1 in vtiger_crmentity table). Unfortunately, the vtwsclib doQuery() function works only with modules and not directly with tables. So I tried to use the vtwsclib doInvoke() with a custom webservice:

- I added my webservice in the operation table:

INSERT INTO `vtiger_ws_operation` ( `name`, `handler_path`, `handler_method`, `type`, `prelogin`) VALUES ('my_webservice_method', 'include/Webservices/WbsWebserviceMethod.php', 'vtws_my_webservice_method’, 'GET', 0);

- I added the only parameter I need in the parameters table:

INSERT INTO `vtiger_ws_operation_parameters` (`operationid`, `name`, `type`, `sequence`) VALUES (35, 'key', 'String', 1);

- I created the 'include/Webservices/WbsWebserviceMethod.php':

<?php
function vtws_my_webservice_method($key) {
    return true;
}
?>

- I call the custom webservice from my external php:

<?php
function vtws_my_webservice_method($key) {
  // some other code and login. Login is successful.
  $results = $client->doInvoke('vtws_my_webservice_method', ['key' => $key], 'GET');
  var_dump($results);
}
?>

but it doesn't work, the doInvoke() returns false. Did I miss something?

Thanks




_______________________________________________
http://www.vtiger.com/
Reply | Threaded
Open this post in threaded view
|

Re: how to get deleted records via webservice

lajeesh k-2
Hi,

try returning array data

Regards,
Lajeesh
Freelance developer / entrepreneur



On Fri, Sep 6, 2019 at 7:02 PM lucia digirolamo <[hidden email]> wrote:

Hi,

I have an external php script who programmatically check a vtiger 6.4. In order to do so, I've used the vtwsclib library. Now I need to get the records that have been deleted in the crm (records which have deleted = 1 in vtiger_crmentity table). Unfortunately, the vtwsclib doQuery() function works only with modules and not directly with tables. So I tried to use the vtwsclib doInvoke() with a custom webservice:

- I added my webservice in the operation table:

INSERT INTO `vtiger_ws_operation` ( `name`, `handler_path`, `handler_method`, `type`, `prelogin`) VALUES ('my_webservice_method', 'include/Webservices/WbsWebserviceMethod.php', 'vtws_my_webservice_method’, 'GET', 0);

- I added the only parameter I need in the parameters table:

INSERT INTO `vtiger_ws_operation_parameters` (`operationid`, `name`, `type`, `sequence`) VALUES (35, 'key', 'String', 1);

- I created the 'include/Webservices/WbsWebserviceMethod.php':

<?php
function vtws_my_webservice_method($key) {
    return true;
}
?>

- I call the custom webservice from my external php:

<?php
function vtws_my_webservice_method($key) {
  // some other code and login. Login is successful.
  $results = $client->doInvoke('vtws_my_webservice_method', ['key' => $key], 'GET');
  var_dump($results);
}
?>

but it doesn't work, the doInvoke() returns false. Did I miss something?

Thanks



_______________________________________________
http://www.vtiger.com/

_______________________________________________
http://www.vtiger.com/