[Vtigercrm-developers] Workflows do not get triggered when creating Sales Order from Webservices

nilay khatri nilay.spartan at gmail.com
Sat Aug 7 07:20:02 GMT 2021


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

			$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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210807/7b9baf63/attachment.html>


More information about the vtigercrm-developers mailing list