﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Insert Fails on BOs Created From Views</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 20:27:46 GMT</lastBuildDate><ttl>20</ttl><item><title>Insert Fails on BOs Created From Views</title><link>http://forum.strataframe.net/FindPost15476.aspx</link><description>When we attempt to do an NewRow/Save through a BO that was created based on a VIEW, we get this error&lt;/P&gt;&lt;P&gt;"Cannot create INSERT command because the business object does not contain any PrimaryKeyFields"&lt;/P&gt;&lt;P&gt;I tried to set the PrimaryKey in the BO but that is a read only property.&lt;/P&gt;&lt;P&gt;Is there a way to work around this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Clay</description><pubDate>Thu, 10 Apr 2008 17:18:17 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Insert Fails on BOs Created From Views</title><link>http://forum.strataframe.net/FindPost15513.aspx</link><description>Glad to hear it :)</description><pubDate>Thu, 10 Apr 2008 17:18:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Insert Fails on BOs Created From Views</title><link>http://forum.strataframe.net/FindPost15504.aspx</link><description>Thanks much folks...that did the trick.</description><pubDate>Thu, 10 Apr 2008 12:15:11 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Insert Fails on BOs Created From Views</title><link>http://forum.strataframe.net/FindPost15489.aspx</link><description>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.&amp;nbsp; So ensure that your view is updatable and then open the BO Mapper and specify a primary key override for the view.</description><pubDate>Wed, 09 Apr 2008 22:22:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Insert Fails on BOs Created From Views</title><link>http://forum.strataframe.net/FindPost15480.aspx</link><description>Hi Clay,&lt;P&gt;Check the help topic "Business Object Mapper -&amp;gt; Configuring Business Object" where it will show you an option in the BOM to Overrride the Primary Key.&amp;nbsp; I believe that is what you are missing for.&lt;/P&gt;&lt;P&gt;Here is the quote from the help file:&lt;/P&gt;&lt;P&gt;[quote]&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Override Primary Key&lt;/TD&gt;&lt;TD&gt;When checked, this specification will override the primary key&amp;nbsp;retrieved through the schema mapping. This is useful&amp;nbsp;when a primary key&amp;nbsp;is not be specified on the table itself,&amp;nbsp;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.&lt;BR&gt;&lt;BR&gt;To define a new primary key specification: &lt;OL&gt;&lt;LI&gt;Click the browse button (&lt;B&gt;...&lt;/B&gt;) to the right of the text field. A dialog will be displayed containing a list of available fields. &lt;LI&gt;Place a check next to the fields to be used as the primary key. A&amp;nbsp;compound key may be created by checking more than one field. &lt;LI&gt;Click the &lt;SPAN class=fth&gt;OK&lt;/SPAN&gt; button to accept the new primary key specification.&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;[/quote]</description><pubDate>Wed, 09 Apr 2008 17:51:01 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>