aply edit don't call Update_Portal method

aply edit don't call Update_Portal method

Old forum URL: forums.lhotka.net/forums/t/6848.aspx


Programmer1987 posted on Saturday, April 25, 2009

I called BeginEdit for busines object before binding it

the object class inherit from Businessbase class

when user click Ok button I call Applyedit but the last one don't call update_portal method

so I called the save method After Applyedit method

I know that there is no need to do that so I made mistake somewhere in business class code

could any one tell me where could be a problem ?!?

Marjon1 replied on Saturday, April 25, 2009

Depending on what version you are on, there have been some changes to the way saving of objects should be done. You have always been encouraged to save this way, but it wasn't always enforced in earlier versions.

You should always have code that looks like the following line in your save method:
BusinessObj = BusinessObj.Save()

The ApplyEdit calls just decrease the EditLevel value and essentially mark all the changes as complete and therefore no longer undoable. It does not actually save the object.

Programmer1987 replied on Sunday, April 26, 2009

I'm using the last version of CSLA 3.6.1

any way I called Save method after calling applyedit

and works well

but I want to what happen because other business classes don't need save method after applyedit called

any way thanks a lot.

Programmer1987 replied on Sunday, April 26, 2009

may be I discovered the problem

my business class don't have parent I mean it is the root

so the  private parent property is null

and as i noticed the save method called in csla code when calling applyEdit FROM :

save method called from parent object so when lovely business class don't have parent

save method will not called ????!!!!!!1

maybe I'm wrong ,aren't I ?

Copyright (c) Marimer LLC