<div dir="ltr">Wow, I didn't know that you could do that in 5.4 either... and to be honest it does sound like a not very useful feature.<div><br></div><div>To get around it, I think the client should just set the SO in a "canceled" status and then create a new one from the quote they want.</div><div><br></div><div>Having said that, I created an extension to load line items into quotes. Basically, you copy-paste a list of quantities and codes into a field and load the line items using an ajax request and some jquery. What you are looking to achieve sound pretty similar to what this does:</div><div><br></div><img src="cid:ii_l2htzh7t0" alt="line_items_loader.gif" style="margin-right: 0px;"><div><br></div><div>You would just need to add an eventlistener to the "Quote" field in SO and call an action that gets you the quote's information. Then load the line items into the line items table using jquery (this last part is exactly what I do in my extension).</div><div><br></div><div>Let me know if you have further questions or would like me to cooperate in some way<br><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></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 26, 2022 at 3:57 AM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@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">Interesting request from a customer...<br>
<br>
We've recently upgraded them from 5.4.0 to 7.4.0.<br>
<br>
They explained something that I never knew happened in 5.4.0, but they <br>
would like it happen in 7.4.0 too.<br>
<br>
If you have a Sales Order, and in vtiger 5.4.0 you change the related <br>
quote in the quote_id field and save it (recall you could only edit <br>
reference fields in EditView in 5.4.0), it replaces most of the related <br>
data in the Sales Order, including LineItems, as if you had used the <br>
"Generate Sales Order" button from within the Quote.<br>
<br>
See the EditView script in vtiger 5.4.0 in SalesOrders for example. <br>
There is a line:<br>
<br>
> if (isset ($_REQUEST['convertmode']) && $_REQUEST['convertmode'] == 'update_quote_val') {<br>
<br>
This basically replaces all the line item data from the new quote_id <br>
wiping what was in this Sales Order before.<br>
<br>
I can see why this shouldn't really be allowed to happen to be honest <br>
but the customer would like me to re-implement this feature. as they <br>
used it a lot in their old system.<br>
<br>
But I am struggling to find a suitable method in the Inventory or Vtiger <br>
classes which will allow me to "load" lineItem data directly into the <br>
Record model during the save operation? From what I can see, what <br>
happens currently is that the LineItem data is taken from the DOM when <br>
you do a save and there doesn't seem to be a mechanism to achieve what I <br>
want without having to get rather complicated and reload the screen once <br>
or twice and then force a save event. This is pretty messy when using an <br>
Ajax save for example.<br>
<br>
I doubt this makes much sense but maybe writing out this issue will help <br>
me think it through a bit more...<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>