<div dir="ltr"><div>I'm working on a similar project and would also be interested in a bulk update/insert mode.</div><div><br></div>Regarding usernames and ids, I would recommend first doing a query to retrieve all usersnames with ids and load it into an array. Then process all the records and use the array to get the ids given the usernames. That way, you don't have to do a query in order to retrieve the correct userid for each row in your CSV.<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 Fri, Jan 15, 2021 at 4:48 PM Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</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">Hi,<br>
<br>
I've a project where we have to import Orgs, Quotes, Sales Orders and Invoices. Each import has to do a lot of db queries to find if the record is new or to update, get assigned_user_id, get org to connect to etc<br>
<br>
The process is:<br>
Read CSV -> map to entity -> check if entity is already imported:<br>
a. It’s imported and not changed<br>
b. It’s imported and changed<br>
c. It’s a new record<br>
-> call vtws_update/create<br>
<br>
Is there a way to make a large commit from the API?<br>
<br>
So suppose there are 10 records: 8 to update and 2 create, is there a way to create/update in bulk, like an array contains all the different entities and saving/updating and committing to db?<br>
<br>
Also is there a way to specify username instead of userid or account name instead of accounted, in general is it possible to specify a String field instead of id? Would reduce a lot of queries.<br>
<br>
Sukhdev Mohan<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>