550
Views
4
Comments
Solved
[].dbo.[] with key 0 was not updated
Service Studio Version
11.10.14 (Build 39594)

[] .dbo. [] with key 0 has not been updated

I am trying to update an entity but I get the error, [] .dbo. [] with key 0 has not been updated follows the oml below, I am assigning the id correctly.




BuyApp.oap
2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Fabiano,


You are trying to update a record with Id = 0, in other words, you're trying to update a record which does not exist.

In the CarrinhoUpdate action, you need to make sure the Carrinho.Id is filled in:


Since you know best the logic you want to implement, it should be easy for you to know make sure you fill the Carrinho.Id correctly.


Kind Regards,
João 

UserImage.jpg
Fabiano Ferreira

I didn't realize that the Cart was going null, in vdd I was controlling with ProductId, anyway I ended up having a problem using the logic of createUpdate and Update


I solved the problem by putting a logic only, because this is going to be duplicated too

2021-06-09 13-39-18
Agno Silveira
 
MVP
Solution

Hi Fabiano,

For knowledge, you can also create an object as an input parameter.

In this way, when adding new fields to your table [Carrinho], it is not necessary to create these fields as Action(CarrinhoUpdate) input parameters:

Regards.

UserImage.jpg
Fabiano Ferreira
I used his solution, not least because it generated duplicate results
2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Fabiano,


You are trying to update a record with Id = 0, in other words, you're trying to update a record which does not exist.

In the CarrinhoUpdate action, you need to make sure the Carrinho.Id is filled in:


Since you know best the logic you want to implement, it should be easy for you to know make sure you fill the Carrinho.Id correctly.


Kind Regards,
João 

UserImage.jpg
Fabiano Ferreira

I didn't realize that the Cart was going null, in vdd I was controlling with ProductId, anyway I ended up having a problem using the logic of createUpdate and Update


I solved the problem by putting a logic only, because this is going to be duplicated too

2021-06-09 13-39-18
Agno Silveira
 
MVP
Solution

Hi Fabiano,

For knowledge, you can also create an object as an input parameter.

In this way, when adding new fields to your table [Carrinho], it is not necessary to create these fields as Action(CarrinhoUpdate) input parameters:

Regards.

UserImage.jpg
Fabiano Ferreira
I used his solution, not least because it generated duplicate results
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.