﻿<?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  » Error retrieving primary key</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 12 Jun 2026 13:12:18 GMT</lastBuildDate><ttl>20</ttl><item><title>Error retrieving primary key</title><link>http://forum.strataframe.net/FindPost2083.aspx</link><description>When I try to add a new record to my business object, I am getting the following error.&amp;nbsp; The business object has records in it, and I can access the primary key field in debug.&amp;nbsp; I can edit and save a record, just can't add new.&amp;nbsp; Not sure what the problem is here, but please offer a suggestion.&lt;/P&gt;&lt;P&gt;8/3/2006 1:30:11 PM&lt;BR&gt;Source: MicroFour StrataFrame Business&lt;BR&gt;Message: An error occurred while retrieving the primary key from the parent business object.&lt;BR&gt;Stack:&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.NewRow()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.Add(Boolean CheckSecurity)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.Add()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at BBS.GUI.BaseControls.MaintStrip.button_Click(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.OnClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.XtraEditors.BaseControl.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)</description><pubDate>Thu, 03 Aug 2006 14:20:13 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Error retrieving primary key</title><link>http://forum.strataframe.net/FindPost2087.aspx</link><description>No problem :)</description><pubDate>Thu, 03 Aug 2006 14:20:13 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Error retrieving primary key</title><link>http://forum.strataframe.net/FindPost2086.aspx</link><description>Yep, I had the parent relationship reversed.&amp;nbsp; The child was supposed to be the parent, and vice versa.&amp;nbsp; I fixed that and it works great now.&amp;nbsp; Thanks for the help!</description><pubDate>Thu, 03 Aug 2006 14:19:33 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Error retrieving primary key</title><link>http://forum.strataframe.net/FindPost2085.aspx</link><description>It looks as though you have a relationship established between this business object and another.&amp;nbsp; Do you have the ParentBusinessObject property set?&amp;nbsp; It is as though it is attempting to get the primary key value of the parent BO, but either the parent business object is not set properly or the field it is requesting is not available.&amp;nbsp; If both of these are set properly, is there a valid record set as the current index of the parent business object?</description><pubDate>Thu, 03 Aug 2006 13:54:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error retrieving primary key</title><link>http://forum.strataframe.net/FindPost2084.aspx</link><description>There should be an inner exception that will contain more detailed information.&amp;nbsp; Most likely, the parent business object does not have any records in it, and so you cannot add a record to the child because the child business object is trying to maintain the relationship to the parent.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Check the inner exception.&amp;nbsp; If it says something like "could not evaluate current row Count:0, CurrentRowIndex: -1 then there is no parent record for the children you are trying to add.</description><pubDate>Thu, 03 Aug 2006 13:54:40 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>