cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trjackson77
Advocate II
Advocate II

ForAll and ThisRecord functionality change or broken?

Last weekend, two apps, which worked just fine broke.  I've been investigating this week and it seems to be problems with the ThisRecord in a ForAll loop.  Essentially what the app did previously was to update a set of records with new values.  From this week it seems that instead of updating 'ThisRecord' it creates a new record with the updated data (and blank data for the fields that are not updated.

 

Here is a code snippet of one of the loops:

 

ForAll(
            Filter(
                colWorkingRecords,
                RecordSelected
            ),
            Switch(
                drpUpdateAllType.Selected.Value,
                "List Price",
                Patch(
                    colWorkingRecords,
                    ThisRecord,
                    {
                        StandardSales: ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)),
                        CurrentBestSales: ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)),
                        RecordAmended: true,
                        CurrentMargin: (ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)) - ThisRecord.CurrentBestCost) / (ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)))
                    }
                ),
                "Base Price Band",
                Patch(
                    colWorkingRecords,
                    ThisRecord,
                    {
                        BaseSales: ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)),
                        CurrentBestSales: ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)),
                        RecordAmended: true,
                        CurrentMargin: (ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100)) - ThisRecord.CurrentBestCost) / (ThisRecord.CurrentBestCost / (1 - (Value(txtUpdateAllValue.Text)/100))),
                        BasePriceStart: dteAllStartDate.SelectedDate
                    }
                )
            )

 

 

I'm interested to fix the issue but I'd also like to understand why the functionality worked fine and then changed.  Am I missing some major notifications somewhere?

 

Thanks in advance for any help or pointers in the right direction.

 

trjackson77_0-1618563038244.png

 

0 REPLIES 0

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,762)