SugarCRM

SugarCRM: Copy Saved Search

This is an example query of how to duplicate a record on a MySQL DB.

The only challenge here is to autogenerate de ID (this has to be done specifically based on your DB structure).

SELECT id, name, search_module, deleted, date_entered, date_modified, assigned_user_id, contents, description
FROM crm_em.saved_search

WHERE
search_module = “Leads”
AND name = “Employees_Updated”;

INSERT INTO saved_search
(id, name, search_module, deleted, date_entered, date_modified, assigned_user_id, contents, description)

SELECT AUTO_INCREMENT,name, search_module, deleted, date_entered, date_modified, “67cd8931-6ffa-50ad-f14c-5c2d44b5a253”, contents, description

FROM crm_em.saved_search

WHERE
search_module = “Leads”
AND name = “Employees_Updated”;

Leave a Reply

Your email address will not be published. Required fields are marked *