Hi,
I have two lists - main list and related list. I have created a related field in the second list called IDRefSec which automatically gets populated with the ID from the main list.
When I open the record, I use the following code to locate the related record (in the Items property):

What I am now trying to do is patch the current open related record. In my other screens, I reference the ID of the selected gallery, however because this record is not opened from a Gallery, I am not sure how to reference it, my code is as follows:
// With varSecRec collection
// Check if related record exists. If it does not, then patch as a new record
ClearCollect(
varSecRec,
Sort(
NewEmployeeSecurity,
ID,
Descending
)
);
If(
IsBlank(
LookUp(
varSecRec,
(IDRefSec = varCurrRecord)
)
),
Patch(
NewEmployeeSecurity,
Defaults(NewEmployeeSecurity),
frmSecurityDetails.Updates;
),
Patch(
NewEmployeeSecurity,
{ID = <<<<CURRENT OPEN RECORD BEING EDITED>>>>},
frmSecurityDetails.Updates
)
);
Set(
varSaveStatus,
"Saved"
)
Its the second patch command I am trying to get working.
Any help is always greatly appreciated.
Cheers,
Geoff.