<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">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>