Hi All,
I've run into a strange issue building an app that I can't get my head around.
Background
I have a custom table inside dataverse, called Logs. Whenever a Power Automate flow runs to synchronize some data to an external system, if an error is encountered, then a Log record is written into dataverse.
On the Log table I have a polymorphic field called 'regarding'. The Polymorphic field can link to the Accounts Table, or a Custom Table called 'Sites'.
This all works completely fine.
Problem
In a Canvas App I have two collections, in which I am trying to establish records that have had synchronization issues in the past.
So I have one collection for Accounts that have had Sync issues, and another for Sites that have had sync issues.
For my Accounts collection, I have used the following:
ClearCollect(
colAccounts(
AddColumns(
"Sync Errors", CountRows(
Filter(
Logs,
'Status Reason' = 'Status Reason (Logs)'.Error And
AsType(Regarding,Accounts).Account = Account
)
)
)
)
This works fine, no problems at all. However for my Sites Collection I am using:
ClearCollect(
colSites(
AddColumns(
"Sync Errors", CountRows(
Filter(
Logs,
'Status Reason' = 'Status Reason (Logs)'.Error And
AsType(Regarding,new_sites).Site = Site
)
)
)
)
Which is throwing delegation warnings, and as the data set grows I have started to see issues.
What is the issue here? The construct is exactly the same between each collection, the only difference as I can see it is that one is based on an OOTB table, whereas the other is based on a custom table?
Is there any issues around delebale queries on custom tables that I'm unaware of?
Thanks in advance for any help, suggestions, or an alternative method to solve my problem.
Regards,