cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oscartorom1
Regular Visitor

Why am I getting this delegation warning even though I use SQL Server as my data source? And how can I overcome this issue?

I came to SQL server because of delegation. I am trying to update 10 elements each time from a gallery with a Patch, however, I came accross a delegation warning.

oscartorom1_0-1599104343834.png

oscartorom1_1-1599104430257.png

I moved my data to a different data source to avoid this but it keeps on coming.

Any help? Should I just ignore it? 

I am worried information might get lost in the future.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @oscartorom1 ,

The As statement is highly useful for disambiguation, particularly when (as you were) patching back data originating from the same data source. I was going to go the direction you have taken next, but it was strange you were patching the wrong records - normally the issue is that it is not patching at all or creating new records.

Simplifying this a bit further, refer to the fields, not the controls, so

ForAll(
   ForecastGotlery.AllItems As MyPatch,
   Patch(
   '[dDo].[ProjCostFc]',
   {ID:MyPatch.ID},
   {
      Ql: MyPatch.Ql), 
      Q2: MyPatch.Q2), 
      Q3: MyPatch.Q3), 
      Q4: MyPatch.Q4), 
      FY1: MyPatch.FYI), 
      FY2: MyPatch.FY2)
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @oscartorom1 ,

I am not an SQL user, and this is a bit of a guess, but the only thing I can see there that could possibly be causing the warning is the Value to the id control (which I assume is a label in the gallery). If so, why not just base it on the ID itself

ForAll(
   ForecastGotlery.AllItems As MyPatch,
   Patch(
   '[dDo].[ProjCostFc]',
   {ID:MyPatch.ID},
   {
      Ql: Value(InputQl.Text), 
      Q2: Value(InputQ2.Text), 
      Q3: Value(InputQ3.Text), 
      Q4: Value(InputQ4.Text), 
      FY1: Value(Inputfyl.Text), 
      FY2: Value(Inputfy2.Text)
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

This looked good (and I thought it was genious), but it sort of patches all the item with the values from the last item.

I tried something similar and got the opposite (I would iterate over one patch).

 

I think the answer must be there somewhere, I just can't figure out how to successfully patch each row with its own values.

 

Thanks @oscartorom1 ,

That is a bit strange - I assume the ID is in the gallery data?

A bit of a long shot, but try this

 

ForAll(
   ForecastGotlery.AllItems As MyUIf,
   UpdateIf(
   '[dDo].[ProjCostFc]',
    ID=MyUIf.ID,
   {
      Ql: Value(InputQl.Text), 
      Q2: Value(InputQ2.Text), 
      Q3: Value(InputQ3.Text), 
      Q4: Value(InputQ4.Text), 
      FY1: Value(Inputfyl.Text), 
      FY2: Value(Inputfy2.Text)
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

This worked:

oscartorom1_0-1599109694135.png

Did reallized I should be using values from MyPatch rather than values from the gallery directly.

 

Delegation disappeared as well.

 

Many thanks! I would have never thought of doing it this way.

Hi @oscartorom1 ,

The As statement is highly useful for disambiguation, particularly when (as you were) patching back data originating from the same data source. I was going to go the direction you have taken next, but it was strange you were patching the wrong records - normally the issue is that it is not patching at all or creating new records.

Simplifying this a bit further, refer to the fields, not the controls, so

ForAll(
   ForecastGotlery.AllItems As MyPatch,
   Patch(
   '[dDo].[ProjCostFc]',
   {ID:MyPatch.ID},
   {
      Ql: MyPatch.Ql), 
      Q2: MyPatch.Q2), 
      Q3: MyPatch.Q3), 
      Q4: MyPatch.Q4), 
      FY1: MyPatch.FYI), 
      FY2: MyPatch.FY2)
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (51,381)