<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-15">
</head>
<body>
<div class="moz-cite-prefix">
<div class="moz-cite-prefix">That TRUE value stops the before and
after save events</div>
<div class="moz-cite-prefix">look at</div>
<div class="moz-cite-prefix"><a class="moz-txt-link-freetext"
href="https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L408">https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L408</a></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I think it's due to <br>
</div>
<div class="moz-cite-prefix">$currentBulkSaveMode === TRUE</div>
<div class="moz-cite-prefix">on create for some reason, that is
probably false on update and revise<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Vincenzo</div>
<div class="moz-cite-prefix"><br>
</div>
</div>
<div class="moz-cite-prefix">Il 07/08/21 09:20, nilay khatri ha
scritto:<br>
</div>
<blockquote type="cite"
cite="mid:CAFJh29xAnEzNS-+=iVwC=gsvaSDtCeXY2xb1DyJeH3ane71zaw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
<div dir="ltr">We are creating Sales Orders via vtws_create
function and none of the workflows would trigger!
<div><br>
</div>
<div>However it does work if we create from UI or use record
models.</div>
<div><br>
</div>
<div>Did some digging and found out, this is due to Bulk save
mode being set explicitly..</div>
<div><br>
</div>
<div>WHY?</div>
<div><br>
</div>
<div><a
href="https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L34"
moz-do-not-send="true">https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L34</a><br>
</div>
<div><br>
</div>
<div>
<pre class="gmail-code gmail-highlight" style="box-sizing:border-box;overflow:auto hidden;font-family:Menlo,"Liberation Mono",Consolas,"DejaVu Sans Mono","Ubuntu Mono","Courier New","andale mono","lucida console",monospace;padding:10px;margin-top:0px;margin-bottom:0px;word-break:break-all;color:rgb(51,51,51);border-top:none;border-right:none;border-bottom:none;border-left:1px solid rgb(187,187,187);border-radius:0px;font-size:13px;line-height:1.5"><code style="box-sizing:border-box;font-family:Menlo,"Liberation Mono",Consolas,"DejaVu Sans Mono","Ubuntu Mono","Courier New","andale mono","lucida console",monospace;font-size:inherit;padding:0px;color:inherit;background-color:transparent;border-radius:0px"><span id="gmail-LC30" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-nx" style="box-sizing:border-box">vglobal</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-s1" style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span class="gmail-p" style="box-sizing:border-box">);</span></span>
<span id="gmail-LC31" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-k" style="box-sizing:border-box;font-weight:bold">if</span> <span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">===</span> <span class="gmail-k" style="box-sizing:border-box;font-weight:bold">NULL</span><span class="gmail-p" style="box-sizing:border-box">)</span> <span class="gmail-p" style="box-sizing:border-box">{</span></span>
<span id="gmail-LC32" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-kc" style="box-sizing:border-box;font-weight:bold">false</span><span class="gmail-p" style="box-sizing:border-box">;</span></span>
<span id="gmail-LC33" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-p" style="box-sizing:border-box">}</span></span>
<span id="gmail-LC34" class="gmail-line gmail-hll" style="box-sizing:border-box;display:inline;background-color:rgb(248,238,199)"> <span class="gmail-nx" style="box-sizing:border-box">vglobal</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-s1" style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span class="gmail-p" style="box-sizing:border-box">,</span> <span class="gmail-kc" style="box-sizing:border-box;font-weight:bold">true</span><span class="gmail-p" style="box-sizing:border-box">);</span></span>
<span id="gmail-LC35" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-k" style="box-sizing:border-box;font-weight:bold">global</span> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentModule</span><span class="gmail-p" style="box-sizing:border-box">;</span></span>
<span id="gmail-LC36" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentModule</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$elementType</span><span class="gmail-p" style="box-sizing:border-box">;</span></span>
<span id="gmail-LC37" class="gmail-line" style="box-sizing:border-box;display:inline"></span>
<span id="gmail-LC38" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$element</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-k" style="box-sizing:border-box;font-weight:bold">parent</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">::</span><span class="gmail-na" style="box-sizing:border-box;color:teal">create</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-nv" style="box-sizing:border-box;color:teal">$elementType</span><span class="gmail-p" style="box-sizing:border-box">,</span> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$element</span><span class="gmail-p" style="box-sizing:border-box">);</span></span>
<span id="gmail-LC39" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$focus</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-nx" style="box-sizing:border-box">CRMEntity</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">::</span><span class="gmail-na" style="box-sizing:border-box;color:teal">getInstance</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-nv" style="box-sizing:border-box;color:teal">$elementType</span><span class="gmail-p" style="box-sizing:border-box">);</span></span>
<span id="gmail-LC40" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$focus</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">-></span><span class="gmail-na" style="box-sizing:border-box;color:teal">updateMissingSeqNumber</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-nv" style="box-sizing:border-box;color:teal">$elementType</span><span class="gmail-p" style="box-sizing:border-box">);</span></span>
<span id="gmail-LC41" class="gmail-line" style="box-sizing:border-box;display:inline"></span>
<span id="gmail-LC42" class="gmail-line" style="box-sizing:border-box;display:inline"> <span class="gmail-nx" style="box-sizing:border-box">vglobal</span><span class="gmail-p" style="box-sizing:border-box">(</span><span class="gmail-s1" style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span class="gmail-p" style="box-sizing:border-box">,</span> <span class="gmail-nv" style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span><span class="gmail-p" style="box-sizing:border-box">);</span></span></code></pre>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Vincenzo Bruno (cell. 328-7252923)
Coopyleft (<a class="moz-txt-link-abbreviated" href="http://www.vinsoft.it/coopyleft">www.vinsoft.it/coopyleft</a>)
Digital Polis (<a class="moz-txt-link-abbreviated" href="http://www.digitalpolis.it">www.digitalpolis.it</a>)
Hacklab Cosenza (<a class="moz-txt-link-abbreviated" href="http://www.hlcs.it">www.hlcs.it</a>)
</pre>
</body>
</html>