I have a Parent list A and Child B, they have One to many relationship.
I have form to create a parent item with couple of fields and just below it, grid type fields to create multiple child list item.
ListA.ID = ParentID(column in List B)
Now, If I open any existing record , List A details on the form comes and below list B relevant details are displayed .
ClearCollect(colChildList,Filter(ListB,ParentID = varRecord.ID))
I'm using a collection to add and update record in the ListB fom the grid (colchildlistgrid), everything is working fine.
Now, when i try to create a new ListA item and along with listB item, the parentID of ListB item remains blank, because my ListA item haven't being created yet.
So OnSuccess property of form for listA I used below formula,
Set(varParent,ManHourRebookingRequestForm.LastSubmit);
ForAll(
Filter(
colChildList,
'Created By'.DisplayName = Office365Users.UserProfileV2(User().Email).displayName && Personnel_No = varParent.'Personnel No.' && ParentID = Blank()
),
Patch(
ListB,ThisRecord
,
{
ParentID: varParent.ID
}
));
ForAll is not working for me.
But instead, If I patch a single record of ListB by using
Patch(
ListB,
LookUp(
ListB,
ParentID = Blank() && Personnel_No = ManHourRebookingRequestForm.LastSubmit.'Personnel No.'
),
{
ParentID: ManHourRebookingRequestForm.LastSubmit.ID
}
)
is working fine.
I dont get where its failling to update.
Any expert who can help me understand the error for me.