﻿<?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 » Issues  » Insert with Complex PK including identity field</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 04 Jun 2026 00:40:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Insert with Complex PK including identity field</title><link>http://forum.strataframe.net/FindPost28513.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I'm running into problems trying to insert a record into a BO which has multi-field PK, where one of the fields is&amp;nbsp;identity.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Initially I was getting the error as in post&amp;nbsp;&lt;a href="http://forum.strataframe.net/Topic26039.aspx"&gt;&lt;a href="http://forum.strataframe.net/Topic26039.aspx"&gt;http://forum.strataframe.net/Topic26039.aspx&lt;/a&gt;&lt;/a&gt;. Problem is that&amp;nbsp;when I set&amp;nbsp;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "&gt;PrimaryKeyIsUpdable=False&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "&gt;PrimaryKeyIsAutoIncremented=True&lt;/span&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="Verdana, Tahoma, Arial" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 21px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"&gt;I get the following error:&lt;/span&gt;&lt;/font&gt;&lt;div&gt;"Cannot create INSERT command because a business object with PrimaryKeyIsAutoIncremented = True must have exactly 1 primary key field."&lt;div&gt;What else should I try?</description><pubDate>Tue, 28 Sep 2010 14:06:38 GMT</pubDate><dc:creator>Lukasz Kustusz</dc:creator></item><item><title>RE: Insert with Complex PK including identity field</title><link>http://forum.strataframe.net/FindPost28523.aspx</link><description>Glad you got is working. There are times when I have both an identity field (which I make the PK as you ended up doing) and also another multi-field unique key, which is more business rule related. If this is the case, then I just make a unique index on the other key, which enforces the business rule at the DB level.</description><pubDate>Tue, 28 Sep 2010 14:06:38 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Insert with Complex PK including identity field</title><link>http://forum.strataframe.net/FindPost28520.aspx</link><description>OK, never mind. I recreated the key to include only the identity field (the other two fields were redundant) and it all worked fine.</description><pubDate>Tue, 28 Sep 2010 14:00:12 GMT</pubDate><dc:creator>Lukasz Kustusz</dc:creator></item></channel></rss>