Modifying an entity (maybe a request for functionality)

Posts   
 
    
exp2000
User
Posts: 68
Joined: 13-Apr-2006
# Posted on: 08-May-2006 16:36:19   

This is from the help file.

Modifying an entity Modifying an entity's data is just as simple and can be done in multiple ways: 1. Loading an existing entity in memory, alter one or more fields (not sequenced fields) and call a DataAccessAdapter object's SaveEntity() method 2. Create a new entity, set the primary key values (used for filtering), set the IsNew to false, set one or more other fields' values and call a DataAccessAdapter object's SaveEntity() method. This will not alter the PK fields. 3. Via the DataAccessAdapter's UpdateEntitiesDirectly() method, specifying the primary key fields as the filter.

I am interested in # 2 approach but using a Unique constraint rather then PK. Is it possible. We have a natural keys but also we have a Unique constraing on the RecordID filed that we use for binding in UI. So it would be very nice if we could use this RecordID to do # 2.

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 09-May-2006 09:56:18   

That's where I use the # 3 approach (UpdateEntitiesDirectly) simple_smile

exp2000
User
Posts: 68
Joined: 13-Apr-2006
# Posted on: 09-May-2006 15:33:42   

Thanks Waala, I need to open my mind, I read it and it never occured to me I could specify filter on RecordId. I am just starting to use LLBL so bear with me.