Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining if adding a record or saving an existing rec
Message
From
11/08/2009 16:43:48
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01416856
Message ID:
01417417
Views:
32
Good suggestion Linda,

I might try that myself as I see a use for it also. I may also test to see when that is getting set and how it is used in case there would be a catch to that idea.
Tim

>What about creating a new property in your business object that gets set to the business state before the save begins and doesn't get reset until after your HookPostSave method?
>
>>Hi Linda,
>>
>>I tried what you suggested here previously, however, the oBizObject.State in the PostSave method always has the value of 'Saving' regardless of what you are doing.
>>
>>I am thinking that this property is useful in the PreSave method, but I need to do this after the save has been made.
>>
>>>Hello, Bob
>>>You need to use the mmBusinessState.
>>>
>>>            if (oBizObject.State == mmBusinessState.Added)
>>>            {
>>>                 do something here
>>>             }
>>>
>>>
>>>>Hello all,
>>>>
>>>>I am using the 'HookPostSave' object Hook method for one of my business objects and want to do something only when saving on the add of a new record as opposed to when saving an existing record. The code should be like the following:
>>>>
>>>>
>>>>if (BusinessObject.isAdding)
>>>>{
>>>>     do something here
>>>>}
>>>>else
>>>>     return
>>>>
>>>>
>>>>What property do I need to use to tell me I am adding a new record? Is this something that is available? Or do I need to use another hook method?
>>>>
>>>>TIA
>>>>
>>>>Bob
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform