I am going right round a tree with this thing. 😵Please save me!
I'm building an embedded canvas app for my model-driven app. There are 2 tables, 'PRA Scores' and 'PRA Answers' that are in a many to many relationship with each other. The relationship is called new_PRAScores_have_PRAanswers. The corresponding system table (that invisible thing I can't touch. Grr!) is called new_prascores_have_praanswers.
When I come to update/create PRA Score records, I can do everything but relate the PRA Answers to the record. The error says 'PRA Scores'.'PRA Answers' is not accessible in this context. Here's my code:
//patch Dataverse table from Collection
Patch('PRA Scores',
ShowColumns(ResponseCollection,
"new_PRAQuestion","new_prascoreid","new_PrimaryRiskAssessment","new_score","new_scores")
);
//refresh same Dataverse table
Refresh('PRA Scores');
ClearCollect(patchedScores, Filter('PRA Scores',ThisRecord.'Primary Risk Assessment'.Activity=[@ModelDrivenFormIntegration].Item.Activity));
ForAll(patchedScores As S,
ForAll(Filter(ResponseCollection,new_PRAQuestion.'PRA Question'=S.'PRA Question'.'PRA Question').theAnswers As A,
Relate(S.'PRA Answers',A)
)
);
Why is S.'PRA Answer' not available in this context? What should I do instead? And why is something that should be simple so hard?