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 II
Super User II

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 II
Super User II

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
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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (58,902)