cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Msaldivar
Level: Powered On

Patch function doesn't work

I have a problem and i was searching a lot but i cant find a solution.

I have an SQL Table called "Orden_trabajo" with this columns.

--Date.--User--Equipment--Model

 

I'm trying to use the "Patch" function to create a register in a SQL database. but when i write this:

Patch('[dbo].[Orden_trabajo]'; Defaults('[dbo].[Orden_trabajo]'); {Date: Today() } )

 

The DataSource is underline, like this:  Patch('[dbo].[Orden_trabajo]'; Defaults('[dbo].[Orden_trabajo]'); {Date: Today() } )

and it says:

The data source is read-only, so the patch function cannot write to the

I dont know what i'm doing wrong or what is the problem here, because i have other table in othr application that works correct with that function.

There is a way that i could change the data source to not be read-only?

help, please

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Level 8

Re: Patch function doesn't work

@Msaldivar 

Several threads indicate this error can occur when the SQL table does not have a primary key.  Do you have a primary key for the table Orden_trabajo?  I can't see any obivious primary key based on your columns --Date.--User--Equipment--Model.  Let me know

 

Related Threads:

View solution in original post

3 REPLIES 3
mdevaney
Level 8

Re: Patch function doesn't work

@Msaldivar 

Several threads indicate this error can occur when the SQL table does not have a primary key.  Do you have a primary key for the table Orden_trabajo?  I can't see any obivious primary key based on your columns --Date.--User--Equipment--Model.  Let me know

 

Related Threads:

View solution in original post

Super User
Super User

Re: Patch function doesn't work

The error message you are getting would suggest that the user you used as a connection account to the database in the SQL connector does not have Write access to the database.  Check the permissions in SQL to make sure you have write access for the connection account user.  I don't think your syntax is necessarily wrong its the permissions on the backend database.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Msaldivar
Level: Powered On

Re: Patch function doesn't work

Thank you so much.

That was the problem, i just add a new column as a primary key and it worked

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 449 members 5,363 guests
Please welcome our newest community members: