> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/preservando-relacionamentos-entre-objetos.md).

# Preservando relacionamentos entre objetos

## ![](https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FcfMTqg4Brbm9baWutclZ%2FSummary2-Small-Icon.svg?alt=media\&token=d1cf162d-c02d-4184-988e-7f7350e450fc) Visão geral

Este artigo explica como preservar relacionamentos entre objetos durante uma migração. Para preservar o vínculo entre registros pai e filho durante a migração, os registros filhos migrados devem incluir o **Campo de Relacionamento** que os conecta ao seu pai. Isso se aplica tanto a relacionamentos Mestre-Detalhe quanto a Lookup.

Para saber mais sobre conexões de objetos, consulte a seção sobre conexões de objetos no artigo a seguir.

* [Visão geral dos modelos](/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/visao-geral-dos-modelos.md#object-connections)

## Exemplo de Relacionamento

Neste exemplo, demonstramos como manter o relacionamento entre objetos pai e filho. Isso pressupõe familiaridade com a criação de modelos e a adição de objetos e campos. Se precisar de uma reciclagem, consulte os artigos a seguir.

* [Criando um modelo](/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/criando-um-modelo.md)
* [Adicionando objetos a um modelo](/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/adicionando-objetos-a-um-modelo.md)
* [Adicionando campos aos objetos](/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/adicionando-campos-aos-objetos.md)

{% stepper %}
{% step %}

### Objetos Pai e Filho

A captura de tela abaixo mostra um modelo com o **objeto Account** objeto como pai do **Contato** e **Case** objetos. Nenhum campo extra foi adicionado.

* **Contato**: Este objeto tem um relacionamento Mestre-Detalhe com **objeto Account**.
* **Case**: Este objeto tem um relacionamento Lookup com **objeto Account**.

<div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FEdVQ5fjrR1XWOl7KXwsG%2FPerservingObjectRelationships-S01-01.png?alt=media&amp;token=7d7dcf23-9d4b-4ec2-aebe-a5186ccfc460" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Campo de Relacionamento

Na captura de tela abaixo, ambos os filhos do **objeto Account** objeto têm o **AccountId** campo listado na parte inferior. Este campo, chamado **Campo de Relacionamento**, os conecta ao **objeto Account** objeto. Você deve adicionar este campo a cada objeto filho para preservar o relacionamento durante a migração.

<div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2F9nIJvyNLFVvbkSgDkJxT%2FPerservingObjectRelationships-S02-01.png?alt=media&amp;token=c0bd690e-d0fb-4c66-a5bb-35002c9ec079" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Adicionar Campo de Relacionamento

As instruções abaixo mostrarão como adicionar o Campo de Relacionamento a cada objeto filho.

{% hint style="info" %}
Para instruções mais detalhadas sobre como adicionar um campo a um objeto, veja o artigo a seguir.

* [Adicionando campos aos objetos](/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/adicionando-campos-aos-objetos.md)
  {% endhint %}

1. Clique no **Contato** objeto.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FnvL6zkK1leQoleiUvNU5%2FPerservingObjectRelationships-S03-01.png?alt=media&amp;token=73fc64c3-3160-48ea-ade8-ecc1987f986d" alt="" width="563"><figcaption></figcaption></figure></div>
2. Marque o **ID da Conta \[AccountId]** checkbox.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FJ5rZG3GlU5ua3CtaJibM%2FPerservingObjectRelationships-S03-02.png?alt=media&amp;token=bfa6cef0-1140-4a71-a7dc-93b35b0f597a" alt="" width="563"><figcaption></figcaption></figure></div>
3. Clique **Salvar**.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FzcVVWkVQ3u6HtzMYJ3cj%2FPerservingObjectRelationships-S03-03.png?alt=media&amp;token=492a7d7d-a173-483d-b6f4-b3b79161840b" alt="" width="563"><figcaption></figcaption></figure></div>
4. Clique no **Case** objeto.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2Fp11zaKHUq8yvs5bSvrp1%2FPerservingObjectRelationships-S03-04.png?alt=media&amp;token=2b583766-a242-4424-b79f-cbc604de644b" alt="" width="563"><figcaption></figcaption></figure></div>
5. Marque o **ID da Conta \[AccountId]** checkbox.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2F8jEkYKZzs6GOgmLUHjxW%2FPerservingObjectRelationships-S03-05.png?alt=media&amp;token=d8f8840c-89d6-4314-ac68-82fc3d954021" alt="" width="563"><figcaption></figcaption></figure></div>
6. Clique **Salvar**.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FZvbS74ccRgDLPKr6QZJL%2FPerservingObjectRelationships-S03-06.png?alt=media&amp;token=8120edbc-8844-47fe-bc58-b6ad1b57188b" alt="" width="563"><figcaption></figcaption></figure></div>
7. Clique **Salvar modelo** para salvar suas alterações.

   <div align="left"><figure><img src="https://3756291079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FMSU9q2zZe73gb7CWkf4f%2FPerservingObjectRelationships-S03-07.png?alt=media&amp;token=4ceb1163-ea42-484b-bf44-3363dd7888a4" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/data-migrator/data-migrator-pt-br/modelos/designer-de-modelos/preservando-relacionamentos-entre-objetos.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
