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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,103)