<div dir="ltr">In the case of vtws_update, the workflows do get triggered. It's kind of awkward that they don't when its a  vtws_create<div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Saludos<div><br></div><div>Rubén</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 7, 2021 at 2:22 AM nilay khatri <<a href="mailto:nilay.spartan@gmail.com">nilay.spartan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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" target="_blank">https://code.vtiger.com/vtiger/vtigercrm/blob/master/include/Webservices/LineItem/VtigerInventoryOperation.php#L34</a><br></div><div><br></div><div><pre 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-m_-1342156378958150204gmail-LC30" style="box-sizing:border-box;display:inline">                    <span style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span style="box-sizing:border-box;font-weight:bold">=</span> <span style="box-sizing:border-box">vglobal</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span style="box-sizing:border-box">);</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC31" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;font-weight:bold">if</span> <span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span style="box-sizing:border-box;font-weight:bold">===</span> <span style="box-sizing:border-box;font-weight:bold">NULL</span><span style="box-sizing:border-box">)</span> <span style="box-sizing:border-box">{</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC32" style="box-sizing:border-box;display:inline">                               <span style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span> <span style="box-sizing:border-box;font-weight:bold">=</span> <span style="box-sizing:border-box;font-weight:bold">false</span><span style="box-sizing:border-box">;</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC33" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box">}</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC34" style="box-sizing:border-box;display:inline;background-color:rgb(248,238,199)">                     <span style="box-sizing:border-box">vglobal</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span style="box-sizing:border-box">,</span> <span style="box-sizing:border-box;font-weight:bold">true</span><span style="box-sizing:border-box">);</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC35" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;font-weight:bold">global</span> <span style="box-sizing:border-box;color:teal">$currentModule</span><span style="box-sizing:border-box">;</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC36" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;color:teal">$currentModule</span> <span style="box-sizing:border-box;font-weight:bold">=</span> <span style="box-sizing:border-box;color:teal">$elementType</span><span style="box-sizing:border-box">;</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC37" style="box-sizing:border-box;display:inline"></span>
<span id="gmail-m_-1342156378958150204gmail-LC38" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;color:teal">$element</span> <span style="box-sizing:border-box;font-weight:bold">=</span> <span style="box-sizing:border-box;font-weight:bold">parent</span><span style="box-sizing:border-box;font-weight:bold">::</span><span style="box-sizing:border-box;color:teal">create</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:teal">$elementType</span><span style="box-sizing:border-box">,</span> <span style="box-sizing:border-box;color:teal">$element</span><span style="box-sizing:border-box">);</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC39" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;color:teal">$focus</span> <span style="box-sizing:border-box;font-weight:bold">=</span> <span style="box-sizing:border-box">CRMEntity</span><span style="box-sizing:border-box;font-weight:bold">::</span><span style="box-sizing:border-box;color:teal">getInstance</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:teal">$elementType</span><span style="box-sizing:border-box">);</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC40" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box;color:teal">$focus</span><span style="box-sizing:border-box;font-weight:bold">-></span><span style="box-sizing:border-box;color:teal">updateMissingSeqNumber</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:teal">$elementType</span><span style="box-sizing:border-box">);</span></span>
<span id="gmail-m_-1342156378958150204gmail-LC41" style="box-sizing:border-box;display:inline"></span>
<span id="gmail-m_-1342156378958150204gmail-LC42" style="box-sizing:border-box;display:inline">                       <span style="box-sizing:border-box">vglobal</span><span style="box-sizing:border-box">(</span><span style="box-sizing:border-box;color:rgb(221,17,68)">'VTIGER_BULK_SAVE_MODE'</span><span style="box-sizing:border-box">,</span> <span style="box-sizing:border-box;color:teal">$currentBulkSaveMode</span><span style="box-sizing:border-box">);</span></span></code></pre></div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>