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

Patch function to create Dynamics 365 record throws an error - "An unkown error occurred."

Hi,

 

I have a PowerApp to create a new record in Dynamics 365 custom entity.

My app has an Edit form with 2 input fields, and a button which executes Patch function to create the record.

 

The custom entity has only 2 mandatory fields  - Name and Owner.

When I run the app and click the button, there is no record created in Dynamics 365. 
I see the error "An unknown error occurred" as in the screenshot.

 

I tried using Errors function but there is no error returned.

 

Am I missing something in the Patch function? Any pointers appreciated.

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Akshatha
Regular Visitor

I fixed this and it is working now. The text property of the Text Input control was missing in the Patch function. 

 

Not Working - Patch(PowerAppData, Defaults(PowerAppData),{new_name:TextInput1,new_firstname:TextInput2})

Working - Patch(PowerAppData, Defaults(PowerAppData),{new_name:TextInput1.Text,new_firstname:TextInput2.Text})

View solution in original post

1 REPLY 1
Akshatha
Regular Visitor

I fixed this and it is working now. The text property of the Text Input control was missing in the Patch function. 

 

Not Working - Patch(PowerAppData, Defaults(PowerAppData),{new_name:TextInput1,new_firstname:TextInput2})

Working - Patch(PowerAppData, Defaults(PowerAppData),{new_name:TextInput1.Text,new_firstname:TextInput2.Text})

View solution in original post

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,639)