during a save action an entity's update action failed

Posts   
 
    
dcarlile
User
Posts: 11
Joined: 09-Nov-2006
# Posted on: 22-Nov-2006 18:56:12   

foreach (ProductionRequestItemEntity item in _request.ProductionRequestItems) { item.UpdatedBy = Common.UserInfo.Username; item.ProductionRequestId = _request.Id; item.IsNew = bNewEntity; <-- (FALSE) } try { Common.server.SaveEntityCollection(_request.ProductionRequestItems);

Causes this error: during a save action an entity's update action failed

this code WAS working. I must have changes something, but I cannot figure out what. Does anyone know what can cause this error? Thanks, Dan

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 23-Nov-2006 02:24:54   

Can you also post the information requested in this thread. http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7722

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 10:12:15   

this update can fail if there's no row present with the specified ID. As you specify isnew as false, it will perform an UPDATE query. If that UPDATE query results in 0 rows affected, you'll get this error.

Why do you set Isnew to false manually btw?

Frans Bouma | Lead developer LLBLGen Pro