Joining a sub-object to a parent several levels above

Hi,

I wanted to lay out the requirement and see if somebody can advise on the best way to achieve this.

I have a hierarchy of objects that goes like this:

  • Project (a description of a project that is taking place that needs to be approved);
  • Control Group (A group of controls from the below that is assigned depending on criteria in the project)
  • Control (individual controls that are linked to the project via control groups above)
  • Attestations (confirmation from the user that the control is in place for project that they’re working on)

Attestations should be related to every control and every project. I’ve linked them together (attestations to controls and to projects) but when I use a form to add an attestation (in the control detail section) it doesn’t link it to a control or a project. Therefore, it is effectively lost. I need to either add an attestation to each control and link to a project on creation or I need to add (and then later edit) an attestation to a control and a project in the control details page. However, it’s not clear how I can achieve this because there doesn’t appear to be any way to capture an ID of the control and project currently be viewed to add to the attestation??

The first problem is that I need to create attestations at the outset but there appears to be no way to systematically create all of the necessary reference linking. I thought about using action triggers (when clicking view control, the attestation is created and displayed). However, I don't know how to assign the project ID reference and the control ID reference when that happens (they're not available fields). Or how to programmatically display correct attestation to edit.

Any idea?