cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Responsive Resident
Responsive Resident

form not showing edit

Hello,

 

Easy question, my form connected to my SQL Server is not going into edit mode. Everything is set to DisplayMode.Edit. But it stays in "New". Am i missing something?

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @mmattar ,

 

Does your SQL table have a primary key? I had met the same issue with you that if the table doesn't have a primary key, it just be read-only. So please make sure to define the primary key? It'll need one.

For SQL tables moving forward, please be sure to write your CREATE statement like this:

 

CREATE TABLE dbo.TableName (
    Id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
    ...
)

 

Also you can find it in the prerequisites of SQL connector, source: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-azure-sqldatabas...

Annotation 2019-10-14 162242.pngBest regards,

Sik

 

 

 

View solution in original post

7 REPLIES 7
mdevaney
Super User
Super User

Put this code in the OnSelect property of the button used to Navigate to go your screen holding the form OR the OnVisble property of the screen holding your form.

EditForm(your_form_name);

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up!
mmattar
Responsive Resident
Responsive Resident

yes i have done this, the form still is not becoming in edit mode

@mmattar 

Have you tried changing the DefaultMode property of the Form to

 

Edit
mmattar
Responsive Resident
Responsive Resident

yes, the default mode of the form is in edit

mmattar
Responsive Resident
Responsive Resident

i inserted another form connected to a different table in my SQL Server and it works to edit. When i connected an edit form to this table it does not work, is it something on the SQL end ?

@mmattar
Yes, it would likely be read/write permissions on the SQL table. Check the permissions on the working table and ensure they are matching the non-working table
v-siky-msft
Community Support
Community Support

Hi @mmattar ,

 

Does your SQL table have a primary key? I had met the same issue with you that if the table doesn't have a primary key, it just be read-only. So please make sure to define the primary key? It'll need one.

For SQL tables moving forward, please be sure to write your CREATE statement like this:

 

CREATE TABLE dbo.TableName (
    Id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
    ...
)

 

Also you can find it in the prerequisites of SQL connector, source: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-azure-sqldatabas...

Annotation 2019-10-14 162242.pngBest regards,

Sik

 

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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