cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meneghino
Community Champion
Community Champion

Bug? I get no Error record when patching to a non-existent record in a CDS entity

Hi, I am patching some changes to existing records in a CDS entity.

All is fine if the TextBoxCurrentTransactionID contains an existing ID, but if it contains anything else (like "ABC"), the dots fly above the screen as if communication was going on with the database for a few seconds, but Errors is still empty after that and no changes are made to the entity.

How do we know that the Patch operation did not succeed?

Thanks!

Patch(Transactions, LookUp(Transactions, PrimaryId = TextBoxCurrentTransactionID.Text), {
	VAMtargets_: {PrimaryId: DropdownInputTransactionTarget.Selected.PrimaryId},
	TransactionName: TextInputTransactionName.Text,
	TransactionDateSerial: Value(Text(DatePickerTransactionDate.SelectedDate, "[$-en-GB]yyyymmdd")),
	IsLastOfRound: CheckboxIsLastOfRoundInput.Value
})

 

PS Doing exactly the same with Update() instead of Patch() actually produces the correct error: "The specified record was not found."

2 REPLIES 2
Meneghino
Community Champion
Community Champion

Actually I said in my prevoius post that Update works, but actually you are in a Catch-22 type of situation:

If you do not supply the PrimaryRecorId to the datasource, then you are told that this field is needed.

If you no not supply it, you are told: "PrimaryId Error 9: The specified column is generated by the server and can't be specified."

This must also be unintended behaviour.

Thanks for looking into this.

There seems to ba an issue with the CDS update function. I have a similar problem updating CDS recods from a flow. The update function always returns an error 400.

Details here: https://powerusers.microsoft.com/t5/Flow-Forum/CDS-Update-Record-returns-status-400/m-p/11857#M2849

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,088)