| | | 
StrataFrame Novice
       
Group: StrataFrame Users Last Login: 08/26/2008 10:34:32 AM Posts: 78, Visits: 242 |
| | When we attempt to do an NewRow/Save through a BO that was created based on a VIEW, we get this error "Cannot create INSERT command because the business object does not contain any PrimaryKeyFields" I tried to set the PrimaryKey in the BO but that is a read only property. Is there a way to work around this? Thanks! Clay |
| | | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 6:32:39 PM Posts: 534, Visits: 2,203 |
| | Hi Clay, Check the help topic "Business Object Mapper -> Configuring Business Object" where it will show you an option in the BOM to Overrride the Primary Key. I believe that is what you are missing for. Here is the quote from the help file: | Override Primary Key | When checked, this specification will override the primary key retrieved through the schema mapping. This is useful when a primary key is not be specified on the table itself, when using views (where primary keys cannot be specified on the table at all), when wishing to define compound primary keys, or in cases where you wish to use business object logic without affecting the database.
To define a new primary key specification: - Click the browse button (...) to the right of the text field. A dialog will be displayed containing a list of available fields.
- Place a check next to the fields to be used as the primary key. A compound key may be created by checking more than one field.
- Click the OK button to accept the new primary key specification.
|
Edhy RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:17:19 AM Posts: 4,379, Visits: 4,420 |
| | Edhy is right on the money...you will need to specify a primary key through the BO mapper...you will also need to make the view updatable by binding to the schema. So ensure that your view is updatable and then open the BO Mapper and specify a primary key override for the view. |
| | | | 
StrataFrame Novice
       
Group: StrataFrame Users Last Login: 08/26/2008 10:34:32 AM Posts: 78, Visits: 242 |
| | Thanks much folks...that did the trick. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:17:19 AM Posts: 4,379, Visits: 4,420 |
| Glad to hear it |
| |
|
|