﻿<?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?)  » Can a sub-query be used to fill a BO?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 05:29:34 GMT</lastBuildDate><ttl>20</ttl><item><title>Can a sub-query be used to fill a BO?</title><link>http://forum.strataframe.net/FindPost12200.aspx</link><description>Can I use a sub-query as one of the fields in a sql statement used to fill a BO? E.g. here is an example of the statement I'd like to use:&lt;br&gt;
[codesnippet]Select&lt;br&gt;
   ID&lt;br&gt;
  ,(Select StatusName&lt;br&gt;
    From StatusLookupTable&lt;br&gt;
    Where StatusID = t.StatusID) As StatusName&lt;br&gt;
  ,Title&lt;br&gt;
From TitleTable As t[/codesnippet]&lt;br&gt;
&lt;br&gt;
StatusName wouldn't be a property the BO knows about.&lt;br&gt;
&lt;br&gt;
This is perfectly valid SQL (use it all the time), but when I tried to use this with a bo, it bombed, saying that it couldn't find a field named "(select StatusName...." in the BO. Can this be done? If not any work arounds?</description><pubDate>Fri, 26 Oct 2007 12:50:22 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Can a sub-query be used to fill a BO?</title><link>http://forum.strataframe.net/FindPost12227.aspx</link><description>I got it working.  It wasn't a problem with my query and filling the BO, it was a problem loading that data into a list view.  The problem was that when the column with the sub query was getting filled it was using the sub query to do the replacement, not the alias name.  I changed the DisplayFieldNames on the PopulationListSettings of the ListView to use the alias and boom it worked!:w00t:</description><pubDate>Fri, 26 Oct 2007 12:50:22 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Can a sub-query be used to fill a BO?</title><link>http://forum.strataframe.net/FindPost12215.aspx</link><description>Good to hear.  I always forget about db debugging  :pinch:  I'm sure that will let me know what I'm doing wrong :D&lt;br&gt;
&lt;br&gt;
Thanks Trent!</description><pubDate>Fri, 26 Oct 2007 10:59:33 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Can a sub-query be used to fill a BO?</title><link>http://forum.strataframe.net/FindPost12205.aspx</link><description>Hey Greg,&lt;/P&gt;&lt;P&gt;The BO can execute any query that you can execute on the database.&amp;nbsp; The only time you would have a problem with this type of query would be on an update.&amp;nbsp; You would need to add the the 'StatusName' field to ExcludeFieldsToUpdate/Insert on the BO.&amp;nbsp; Otherwise, if you are having a problem, turn on the debug for the data source and try to see what is going on with your query through the BO.</description><pubDate>Fri, 26 Oct 2007 09:53:21 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>