cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kman42
Helper II
Helper II

Can't create new record on Edit Form

I have an edit form bound to a mysql database. I can edit records fine, but I can't create new records unless I display the id field and enter something. id is the key field in the table and is set to auto-increment. I set the required flag for the field to false and it still doesn't work unless I enter a number in the id field on the form. 

 

Ideally, I wouldn't even show the id field on the form and it would just be created and auto-incremented when the record gets inserted. What am I doing wrong?

 

Thanks!

3 REPLIES 3
v-monli-msft
Community Support
Community Support

Hi @kman42 ,

 

If you cannot create new record, did you encounter any error message while submitting a new record via edit form? 

 

You could add the id field to the edit form, then set its Visible property to false and then have a try.

 

Check if below thread has any information that might help:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/MySQL-ID-Field-required/td-p/242796

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-monli-msft
Community Support
Community Support

 
Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm still trying to create a workaround for this issue. I'm trying to set the default value for the id card to the parent value if the form is in edit mode and to the max value of the database field +1 if it is in new mode.

 

If(NotesForm.Mode=FormMode.New,Max('[notes]'.id)+1,ThisItem.id)

This results in:

The function Max has some invalid arguments. Invalid argument type (Table). Expecting a Number value instead. 

 

id is an integer.

 

Thanks!

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,592)