[Vtigercrm-developers] Bulk insert/update from API

Rubén A. Estrada Orozco rulotec1 at gmail.com
Fri Jan 15 23:09:13 GMT 2021


I'm working on a similar project and would also be interested in a bulk
update/insert mode.

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.

Saludos

Rubén


On Fri, Jan 15, 2021 at 4:48 PM Sukhdev Mohan <s.mohan at myti.it> wrote:

> Hi,
>
> 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
>
> The process is:
> Read CSV -> map to entity -> check if entity is already imported:
> a. It’s imported and not changed
> b. It’s imported and changed
> c. It’s a new record
> -> call vtws_update/create
>
> Is there a way to make a large commit from the API?
>
> 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?
>
> 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.
>
> Sukhdev Mohan
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210115/1692d4a5/attachment.html>


More information about the vtigercrm-developers mailing list