﻿<?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?)  » Issue with a PK...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 05 Apr 2026 08:02:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17153.aspx</link><description>I had a BO that I was setting the PK for manually, then realized I actually wanted it to be an auto-increment PK.  I updated the db, rebuilt the BO, got rid of my SetDefaultValues code, and changed the PrimaryKeyIsAutoincremented and PrimaryKeyIsUpdatable to True and False respectively.&lt;br&gt;
&lt;br&gt;
Now, whenever I try to navigate to a new row, I get a type conversion error from dbnull to integer.  I must be missing something.  Any ideas?</description><pubDate>Thu, 19 Jun 2008 14:16:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17194.aspx</link><description>LOL...good advice :)</description><pubDate>Thu, 19 Jun 2008 14:16:44 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17193.aspx</link><description>Just put some RICE* it.  :P&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
*RICE=Rest Ice Compression Elevation...never to be done on ones head  :hehe:</description><pubDate>Thu, 19 Jun 2008 13:38:25 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17168.aspx</link><description>Hope you didn't hurt your head too much when you slammed in on the desk :D Me...I have huge mountain sized knots protruding from my head pretty much all of the time :crazy:</description><pubDate>Thu, 19 Jun 2008 10:02:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17166.aspx</link><description>[quote]...looks at properties of BO [i]instance[/i]...[b]DOH[/b]...slams head on desk...looks at pretty stars[/quote]&lt;/P&gt;&lt;P&gt;I am sooooo glad that this happens to other programmers, too.&amp;nbsp; Despite our best efforts to prove otherwise, we are all still quite human.&lt;/P&gt;&lt;P&gt;I feel your pain,&lt;BR&gt;Bill&lt;/P&gt;&lt;P&gt;:D</description><pubDate>Thu, 19 Jun 2008 09:04:12 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17158.aspx</link><description>[quote][b]Greg McGuffey (06/18/2008)[/b][hr]The PrimaryKeyIsAutoIncremented and PrimaryKeyIsUpdatable were set on the instance. All is working now.... :satisfied:[/quote]&lt;P&gt;&lt;BR&gt;Glad to hear you found it.&amp;nbsp; This type of things usually takes more than a couple of hours to find and most of the time it is under our nose :).</description><pubDate>Wed, 18 Jun 2008 20:18:21 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17156.aspx</link><description>Well, that's just it.  It is an auto incremented PK. It shouldn't allow NULLs.  What it is acting like is that the PrimaryKeyIsAutoIncremented property is still set to False. &lt;br&gt;
&lt;br&gt;
I checked the SF source and I see no way for a new row with a PK set that is auto incrementing to skip the initialization to -1, -2 etc.  The only way is if the PrimaryKeyIsAutoIncremented is False or if there isn't a PK set on the BO (that I see).  I checked the properties on the BO (they're OK), I checked the designer file itself (it's OK...PK is set, PrimaryKeyIsAutoIncremented is not set (so defaults to True)).  I'm baffled....oh...wait&lt;br&gt;
&lt;br&gt;
[runs to dev computer (er...hits scrolllock scrolllock 2 to get to dev computer on KVM)...opens form where problem is occurring...looks at properties of BO [i]instance[/i]...[b]DOH[/b]...slams head on desk...looks at pretty stars]&lt;br&gt;
&lt;br&gt;
:blush:&lt;br&gt;
&lt;br&gt;
The PrimaryKeyIsAutoIncremented  and PrimaryKeyIsUpdatable were set on the instance.  All is working now....  :satisfied:</description><pubDate>Wed, 18 Jun 2008 18:47:17 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Issue with a PK...</title><link>http://forum.strataframe.net/FindPost17154.aspx</link><description>Hi Greg,&lt;/P&gt;&lt;P&gt;It looks like you are getting DBNull data for that PK value, try setting the Null Value Option in the BOM to Return Alternate on Null with zero or empty string based on your field type.</description><pubDate>Wed, 18 Jun 2008 17:39:36 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>