We have a Dataverse table with a primary key, so other tables can use the key as a lookup. The key is a text format Autonumber column called "ID".
In our canvas app, we have a Patch function inside a ForAll that should create new rows in our Dataverse table. We use Defaults(TableName) to create the new rows. We do not specify what to patch to the primary key column, so that the Autonumber column can create a unique number.
As of last week we have started having a strange issue where we will get network errors ("There are conflicts with changes on the server") intermittently when trying to patch. The patch function will create some of the new rows but not all.
After using the Monitor I have found that the Patch is trying to create a row with an ID that already exists in the table.
We have only seen this happen in our Test/Prod environments, and not our Dev environment.
Can anyone suggest how we fix this?
Error message from the monitor is below (it is in Danish due to my org's language restrictions)
"data": {
"errors": [
{
"Kind": 6,
"Message": "Netværksfejl under brug af Patch-funktion: Der er konflikter med ændringer på serveren. Du bedes genindlæse.",
"Source": "Button_Gem_3.OnSelect",
"Observed": "Button_Gem_3.OnSelect",
"Details": {
"HttpStatusCode": 412,
"HttpResponse": {
"code": "0x80060892",
"message": "Der findes allerede en post, der har attributværdierne Tilsyns_ID. Objektnøglen Tilsyns_ID kræver, at dette sæt attributter indeholder entydige værdier Vælg entydige værdier, og prøv igen.",