Need to reset IsDirty flag

Posts   
 
    
CharlieOz1
User
Posts: 3
Joined: 05-Jul-2006
# Posted on: 27-Jul-2006 06:07:47   

Hi everyone,

I need to reset the IsDirty flag

I have taken over some code where after a successful save is performed the following gets executed:

Dim eStakeholder As StakeholderEntity = CType(eNewEntityBase, StakeholderEntity) m_eItem.Stakeholder.Remove(eStakeholder) m_eItem.Stakeholder.Add(eStakeholder)

the above causes the IsDirty flag to get set to True - and this causes problems later on as the application thinks the object hasn't been saved.

I have searchd the forums but no joy (the closest was Refetch not updating IsDirty Flag http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=1480&HighLight=1)

I have tried eStakeholder.Refetch eStakeholder.FlagAsSaved

eStakeholder.RejectChanges seems to work but comes with

a price to pay as it causes a rollback. Am I safe to use it? I am still fairly new to LLBL and I am not sure of the 'intent' of the code snippet above.

Any ideas? Any solution will help even if it means going back to the db, etc

Thanks Charlie

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Jul-2006 06:29:13   

Why don't you just explicitly set the IsDirty flag to false?

CharlieOz1
User
Posts: 3
Joined: 05-Jul-2006
# Posted on: 27-Jul-2006 06:32:35   

I feel real stoopid today cry

yes

eStakeHolder.IsDirty = False

works!

sorry for slowing the internet down today with my presence

I shall go sit in a dark corner until I feel better.

Charlie

flushed

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Jul-2006 06:41:30   

Not at all you are welcomed to ask whatever you want to ask at any time. Questions are questions, don't classify them to clever ones and stupid ones. In fact some great ideas or findings come out by asking simple questions simple_smile