[Vtigercrm-developers] Workflows do not get triggered when creating Sales Order from Webservices
Vincenzo Bruno
v.bruno at vinsoft.it
Fri Aug 27 10:32:51 GMT 2021
That TRUE value stops the before and after save events
look at
https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L408
I think it's due to
$currentBulkSaveMode === TRUE
on create for some reason, that is probably false on update and revise
Vincenzo
Il 07/08/21 09:20, nilay khatri ha scritto:
> We are creating Sales Orders via vtws_create function and none of the
> workflows would trigger!
>
> However it does work if we create from UI or use record models.
>
> Did some digging and found out, this is due to Bulk save mode being
> set explicitly..
>
> WHY?
>
> https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L34
> <https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L34>
>
> |$currentBulkSaveMode = vglobal('VTIGER_BULK_SAVE_MODE'); if
> ($currentBulkSaveMode === NULL) { $currentBulkSaveMode = false; }
> vglobal('VTIGER_BULK_SAVE_MODE', true); global $currentModule;
> $currentModule = $elementType; $element = parent::create($elementType,
> $element); $focus = CRMEntity::getInstance($elementType);
> $focus->updateMissingSeqNumber($elementType);
> vglobal('VTIGER_BULK_SAVE_MODE', $currentBulkSaveMode);|
>
> _______________________________________________
> http://www.vtiger.com/
--
Vincenzo Bruno (cell. 328-7252923)
Coopyleft (www.vinsoft.it/coopyleft)
Digital Polis (www.digitalpolis.it)
Hacklab Cosenza (www.hlcs.it)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210827/9e4bf0c4/attachment-0001.html>
More information about the vtigercrm-developers
mailing list