Mark as Parent Pointer

From Resco's Wiki
Jump to navigation Jump to search

Resco platform recognizes several well-known parent-child relationships between entities (such as quote vs quotedetail or resco_questionnaire vs resco_question). If you need to bind other entities this way, use the Mark as Parent Pointer setting:

  1. Edit an app project in Woodford.
  2. Select the child entity.
  3. Select lookup property that should point to the parent.
  4. On the Properties pane, enable Mark as Parent Pointer.
  5. Make sure that the lookup targets allow a single entity - our parent entity.

Mark as parent pointer

Implications

Parent-child relationships are used at various places in the app, usually to ensure that both parent and child records are available (all child records for each parent, no orphaned child records, etc.).

The most prominent impact is on synchronization:

  • In the entity download phase of sync, to apply the parent entity's sync filter also for child entity records. I.e., only download child records if their parent records are also downloaded.
  • When uploading local changes during synchronization to establish the order of entities. (Child entities are uploaded after parent entities.)
  • (Dynamics only) This also concerns sync upload: Status changes for parent records are updated only after all associated child records are uploaded.
  • Sync cleanup deletes orphaned child records, i.e., child records whose parent record does not exist. (This includes records that would be deleted by cascading delete.)

Then there is an impact on the delete operation, provided you allow cascading delete in project configuration:

  • When deleting parent entity records, all their child records are deleted as well. (If cascading delete is not allowed, you have to rely on sync cleanup.)

Finally, there is one Salesforce-specific impact, aimed at data download optimization:

  • (Salesforce only) Check Mark as Parent Pointer for sf_attachment.parentid property to download only attachments belonging to records that are available offline. Use this “trick” when you see that sync clears a lot of sf_attachment records, which were just downloaded.