BO IsDirty set to false after failed save


Author
Message
Govinda Berrio
Govinda Berrio
StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
First of all I'd like to say that this is most likely a problem with the way the page is contructed by me. I know that because I created a small test web app that does show what I'm about to explain.



I coded this page doing testing here and there. One day I was on a record that was saved before I had set the require fields validation on the BO. I saved the record, saw the validation error message for one of the required fields being blank, and for some reason I just hit Save again. To my surprise, the form saved successfully. Or rather, the BO.Save() method return "Success". After some digging I found that the BO was losing track of the fact that the record was dirty. It was registering as dirty for the first save (IsDirty == true) but on the second save, IsDirty was false. So I think what's happening is that Strataframe isn't attempting to check rules or save. And I don't do any reloading of the record in between. The BO is part of the BasePage so it's getting stored in the Session.



I tried manually setting the record to dirty with BO.CurrentRow.SetModified() but I get an error saying that the row state has to be Unchanged in order to use SetModified or SetAdded. I tried updating a timestamp field on the BO (ex. Customer.Created = DateTime.Now) and the record was still not registering as dirty.



I'm just going to validate the required fields manually and move on, I've spent too much time on this already.



So I know there's something I'm doing wrong because it works in a simple implementation. But I wanted to get it out there and see if anyone else has had a similar experience and if they found a reason and a solution.



Thanks

Govinda
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Govinda Berrio - 16 Years Ago
Govinda Berrio - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Govinda Berrio - 16 Years Ago
                     Hi,
In my case, the exception thrown caused by database FK...
Chan - 16 Years Ago
                         Still getting this weird behavior. Maybe I'll cook up a batch of...
Govinda Berrio - 16 Years Ago
                             Hi,
May I know if SF team is checking on it?
I need it to be...
Chan - 16 Years Ago
                                 Trent,

you were right about the an exception occuring....
Govinda Berrio - 16 Years Ago
                                     When faced with something like this. The best advice that I have,...
Trent L. Taylor - 16 Years Ago
                                         I was finally able to recreate the problem I was having. But before I...
Govinda Berrio - 16 Years Ago
                                             here is the sample project and data
Govinda Berrio - 16 Years Ago
                                                 I will probably just remove that rollback command
Govinda Berrio - 16 Years Ago
                                                     Looks like I spoke too soon. I can't just remove the command to...
Govinda Berrio - 16 Years Ago
                                                         Trent,

Do you think my solution is appropriate or is this...
Govinda Berrio - 16 Years Ago
                                                             I am sorry I have not yet responded to this post. I have not had a...
Trent L. Taylor - 16 Years Ago
                                                                 Thanks for the update.

While I'm here, I'll add that when...
Govinda Berrio - 16 Years Ago
                                                                     Hi,
Any update?

Thank you
Chan - 16 Years Ago
Chan - 16 Years Ago
Ertan Deniz - 16 Years Ago
Ertan Deniz - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Andrew Harper - 9 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search