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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,761)