cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jacktransform
Helper III
Helper III

SubmitForm Error: The Specified Record Was Not Found

Hi all!

 

I'm having an on-and-off error when submitting a form for my table "Custom Table" in my PowerApp. If I delete a record in my custom table and then try to recreate it (with the same value in the Primary Name Column) by adding a new record, I get this error:

 

The specified record was not found. Server Response: Custom Table failed: CustomTable with ID = (GUID of the record I deleted) Does Not Exist

 

Like I said, this only happens when I delete a record in my custom table and then immediately try to recreate it. It actually doesn't even seem to prevent anything from happening, as the form still submits properly. I just don't want the error to persist for risk that it suddenly breaks my app. 

 

I'm not sure if this makes a difference, but I do have some many-to-many related columns in my form for Custom Table. I used the following blog post to be able to submit my many-to-many columns:

 

How to Implement a Common Data Service Many-to-Many Field on Canvas Power Apps – ReadyXRM

 

I have the code to submit my many-to-many columns after SubmitForm() on the OnSelect property of the button I use to submit my new record in Custom Table.

 

Please let me know if I need to give more information.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
EricRegnier
Super User
Super User

Hi @jacktransform,

After the delete operation, try to do a Refresh? Although the Remove should refresh, I think the canvas app still thinks the record exists so maybe an explicit refresh would work. For exmaple:

Remove(Datasource, recordx); Refresh(Datasource)

Hope this helps...

View solution in original post

jacktransform
Helper III
Helper III

@EricRegnier 

 

I actually did something slightly different. I had to breakup what I had in my OnSelect property to be half on OnSelect and the later half on the OnSuccess property of the form I was submitting (eg: CustomTableEditForm.) Below is an example of my code (keep in mind I am editing many-to-many columns in my edit form. The many-to-many related table is named 'Many to Many Table')

 

In the OnSelect property of my save button:

ClearCollect(manyToManyCollection, manyToManyCardValue.SelectedItems);

SubmitForm(CustomTableEditForm);

Set(varNewRecord, Blank()) // Necessary for next step

 

In the OnSuccess property of my edit form, CustomTableEditForm:

Refresh([@'Custom Tables']);

Set(varNewRecordCustomTableEditForm.LastSubmit);

ForAll(

manyToManyCollection,

Relate(

varNewRecord.'Many to Many Table', ThisRecord

)

);

 

 

This seemed to clear the issue up. Thanks again for your help!

View solution in original post

2 REPLIES 2
EricRegnier
Super User
Super User

Hi @jacktransform,

After the delete operation, try to do a Refresh? Although the Remove should refresh, I think the canvas app still thinks the record exists so maybe an explicit refresh would work. For exmaple:

Remove(Datasource, recordx); Refresh(Datasource)

Hope this helps...

View solution in original post

jacktransform
Helper III
Helper III

@EricRegnier 

 

I actually did something slightly different. I had to breakup what I had in my OnSelect property to be half on OnSelect and the later half on the OnSuccess property of the form I was submitting (eg: CustomTableEditForm.) Below is an example of my code (keep in mind I am editing many-to-many columns in my edit form. The many-to-many related table is named 'Many to Many Table')

 

In the OnSelect property of my save button:

ClearCollect(manyToManyCollection, manyToManyCardValue.SelectedItems);

SubmitForm(CustomTableEditForm);

Set(varNewRecord, Blank()) // Necessary for next step

 

In the OnSuccess property of my edit form, CustomTableEditForm:

Refresh([@'Custom Tables']);

Set(varNewRecordCustomTableEditForm.LastSubmit);

ForAll(

manyToManyCollection,

Relate(

varNewRecord.'Many to Many Table', ThisRecord

)

);

 

 

This seemed to clear the issue up. Thanks again for your help!

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.

Users online (2,984)