Hi all!
I've managed to get rid of all the delegation warnings in my app through the use of collections, better filters etc. I'm stuck on one though!
ClearCollect( submittedRecords, ForAll( 'TA Gallery Add Delivery Styles'.AllItems, Patch( 'Unit List', Defaults('Unit List'), { 'User Name': 'TA - Value - Name'.Text, 'MMU ID': 'TA - Value - ID'.Text, 'Unit Name': 'TA - Value - Unit Name'.Text, 'Unit Credits': Text('TA - Dd - Unit Credits'.SelectedText.Value), 'Delivery Style': Text('TA - Dd - Delivery Style'.SelectedText.Value), 'Hours per Session': Value('TA - Value - Hours'.Text), 'Number of Sessions': Value('TA - Value - Sessions'.Text), 'Teaching Hours': Value('TA - Value - Pre Total Hours'.Text), 'Prep Hours': Value('TA - Value - Pre Total Sessions'.Text), 'Academic Year': Text('Admin - Dd - Academic Year'.SelectedText.Value) } ) ) ); Patch( 'Unit List', LookUp( 'Unit List', ID = First(submittedRecords).ID), { 'Number of Students': Value('TA - Value - # Students'.Text), 'Assessment Allocation': Value('TA - Value - Assessment Allocation'.Text) } );
To summarise the above, I generate a collection of records that I submit, and patch them over to my SP list. However, as you can add multiple enteries under the same record title, I only want my "Number of Students" and "Assessment Allocation" to be copied once, so that when I report, I won't have the remove the duplicate values.
However, when I send those single records here:
Patch( 'Unit List', LookUp( 'Unit List', ID = First(submittedRecords).ID), { 'Number of Students': Value('TA - Value - # Students'.Text), 'Assessment Allocation': Value('TA - Value - Assessment Allocation'.Text) } );
The lookup for the record ID brings back a delegation warning. My only thought is that either its the usage of First, or that the arguments are different types? This is the offending line. The equals and the .ID are the ones with warnings:
ID = First(submittedRecords).ID)
Can anyone help please?