<div dir="ltr">Hi Conrado,<div><br><div><br></div><div>Thanks allot for your explanation, this wasn't clear to me.</div><div>I'm now using the vtws retrieve first and then adding the lineitems in the vtws revise.</div><div><br></div><div><br></div><div>Thanks again guys!</div><div><br></div><div><br></div><div>Kind regards,</div><div><br></div><div>Lennart</div><div class="gmail_extra">
<br><div class="gmail_quote">2016-04-12 13:40 GMT+02:00 Conrado Maggi <span dir="ltr"><<a href="mailto:comaggi@gmail.com" target="_blank">comaggi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Inventory modules expect the products lines to be in a request variable. that is the reason why your code deletes the products. Vtiger is searching for a variable that is empty</div><div><br></div><div>I agree with alan, using the revise method is the way to go. If that does not work,  You can use vtws retrieve first, modify the field and finally revise or update </div><div><br></div><div>Cheers,</div><div>Conrado </div><div class="HOEnZb"><div class="h5"><div><br></div><div><br></div><br><div><br>El martes, 12 de abril de 2016, Lennart van Ballegoij <<a href="mailto:lennart@egmmedia.nl" target="_blank">lennart@egmmedia.nl</a>> escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Guys,<div><br><div><br></div><div>Anyone an idea what's causing the <span style="font-size:12.8px">SalesOrder to loose the attached items on an edit of a field from withing my custom module ?<br><br></span></div><div><span style="font-size:12.8px">I'm still not sure what's causing this problem, i'm thinking of testing the same code on a clean VTiger system tonight to be sure that nothing is interfering with my code.</span></div><div><br></div><div>I've already tested turning of all custom EventHandlers and Workflows but this was not what was causing the SalesOrder to loose attached items.</div><div><br></div><div>Hopefully i will find out more about my issues tonight, any guesses would be appreciated.</div><div> </div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Lennart</div></div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><table style="font-size:12.8px;border-collapse:collapse;border-spacing:0px;color:rgb(0,0,0);font-family:Times"><tbody><tr><td style="font-family:Helvetica,Arial,sans-serif;line-height:18px;color:rgb(102,102,102);font-size:12px">Met vriendelijke groet,</td></tr><tr><td height="24"></td></tr><tr><td style="font-family:'Arial Black',Arial,sans-serif;line-height:18px;color:rgb(244,118,33);font-size:12px;font-weight:bold;text-transform:uppercase">Lennart VAN Ballegoij</td></tr><tr><td style="font-family:Helvetica,Arial,sans-serif;line-height:18px;color:rgb(102,102,102);font-size:12px">Backend Developer</td></tr><tr><td height="24"></td></tr><tr><td><img src="http://egmmedia.nl/wp-content/uploads/2016/01/EGM-Media-logo-retina.png" style="width:200px"></td></tr><tr><td height="24"></td></tr><tr><td><table style="border-collapse:collapse;border-spacing:0px"><tbody><tr><td width="24"><img src="http://egmmedia.nl/wp-content/uploads/2016/01/egm-signature-bubble2.png" style="width:18px"></td><td style="font-family:Helvetica,Arial,sans-serif;padding-right:24px;line-height:18px;color:rgb(102,102,102);font-size:12px">+31 (0) 85 30 300 50</td><td width="24"><img src="http://egmmedia.nl/wp-content/uploads/2016/01/egm-signature-pin2.png" style="width:18px"></td><td style="font-family:Helvetica,Arial,sans-serif;padding-right:48px;line-height:18px;color:rgb(102,102,102);font-size:12px">Westerlaan 51</td></tr><tr><td width="24"></td><td style="font-family:Helvetica,Arial,sans-serif;padding-right:24px;line-height:18px;color:rgb(102,102,102);font-size:12px"><a style="color:rgb(244,118,33);text-decoration:none">lennart@egmmedia.nl</a></td><td width="24"></td><td style="font-family:Helvetica,Arial,sans-serif;padding-right:48px;line-height:18px;color:rgb(102,102,102);font-size:12px">8011 CA Zwolle</td></tr></tbody></table></td></tr><tr><td height="24"></td></tr><tr><td style="font-family:Helvetica,Arial,sans-serif;line-height:15px;color:rgb(102,102,102);font-size:10px">This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. EGM Media is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.</td></tr></tbody></table></div></div></div></div></div>
<br><div class="gmail_quote">2016-04-08 15:01 GMT+02:00 Lennart van Ballegoij <span dir="ltr"><<a>lennart@egmmedia.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Alan,<div><br></div><div><br></div><div>Thanks for your respons, i tried this method right away but for some reason i get the same result :|<br></div><div>My field gets edited just like it should, but the attached items/products <span style="color:rgb(80,0,80);font-size:12.8px">disappear again.</span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><font color="#500050"><span style="font-size:12.8px">To be sure this was not caused by any of my Workflows or Eventhandlers i turned them all off but still the problem persists.</span></font></div><div><br></div><div>Do you have any other ideas on how to fix this or how to workaround this ?</div><div><br></div><div>Thanks in advance,</div><div><br></div><div><br></div><div>Lennart</div><div><div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"></div></div></div></div></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">2016-04-08 12:52 GMT+02:00 Alan Lord <span dir="ltr"><<a>alanslists@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 08/04/16 11:16, Lennart van Ballegoij wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey guys,<br>
<br>
<br>
I'm trying to edit a SalesOrder field from within my custom module.<br>
I've got no problem editing the field but after the save of the record<br>
the attached items/products disappear.<br>
<br>
Has someone encountered this issues before ?<br>
<br>
I'm using the following code to edit the Record:<br>
<br>
$recordModel = Vtiger_Record_Model::getInstanceById($salesorderid, 'SalesOrder');<br>
$recordModel->set('mode','edit');<br>
$recordModel->set('cf_762','1');<br>
$recordModel->save();<br>
</blockquote>
<br></span>
Have you tried using the vtws_revise server API?<br>
<br>
<a href="http://community.vtiger.com/help/vtigercrm/developers/server-apis.html#revise" rel="noreferrer" target="_blank">http://community.vtiger.com/help/vtigercrm/developers/server-apis.html#revise</a><br>
<br>
<br>
Al<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div>
</div></div><br>_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div></div></div>