Merge two Entity types into one

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • telenieko
    Junior Member
    • Mar 2020
    • 9

    Merge two Entity types into one

    Hi,

    I have two entity types: Opportunity and Project

    The Project Entity is the result of our original migration to EspoCRM and are conceptualy the same as Won Opportunities. In fact, from the old system, 99% of Project have an analog on the Opportunity table.

    My users don't like that, me neither!

    I want to "merge" the Projects into Opportunity and then delete the Project Entity from the system, for that I need to:
    1. Do a backup
    2. Match Projects to Opportunity (by a custom field already in place) or Create a new Opportunity if it is not there
    3. Reassign al related objects of the Project to the Opportunity (Tasks, Calls, Meetings, documents, ...)
    4. Reassign the Notes from the Project to the Opportunity
    5. Copy the Entity field values (description, change date, assigned to)
    6. Delete the Projects
    I think "that is all".

    I am know messing around the code seeing how to do that with a small script,
    but I'd appreciate any warnings or recommendations for my journey!

    Thanks,
    marc
Working...