Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Custom command bar button in model-driven apps - unable to copy the Currency column

(0) ShareShare
ReportReport
Posted on by 40

Hi there,

 

I am working on implementing a custom button in a model driven app which duplicates whichever records are currently selected. It has the OnSelect code of:

 

IfError(
 ForAll(Self.Selected.AllItems,
  Patch(Milestones, Defaults(Milestones),
  {
   'Project Name': "Copy of " & ThisRecord.'Project Name',
   'Expected Start Date': ThisRecord.'Expected Start Date',
   Project: ThisRecord.Project,
   Currency: ThisRecord.Currency
  }
 )
);
Notify("The selected item(s) have been copied successfully!", NotificationType.Success, 5000),
Notify("Failed to copy the selected item(s). Please try again.", NotificationType.Error, 5000)
);

 

Currency is a Lookup column to the OOTB Currency table.

 

When I exclude the Currency column from this code (so when the code only has Project Name, Expected Start Date and Project) it works perfectly, but with the Currency column I get this error:

 

Veeks01_0-1715761064264.png

 

From what I can tell, the error isn't happening because Currency is a Lookup column, as Project is also a Lookup column and there is no issue when copying that field to the new record.

 

For anyone who has been configuring custom buttons in model-driven app buttons recently you may be aware that it wasn't working for anyone until Microsoft rolled out a fix just a few days ago so I wonder if that is playing a part in this bug? You can read more about this here: Dataverse Model Driven App Command Bar Power FX Bu... - Power Platform Community (microsoft.com)

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard