Different dynamic list problem

Posts   
 
    
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 25-Oct-2005 01:41:10   

I should probably be putting these in the general forum, as we're now released. Reaaaaally sorry this wasn't found before as we've been running the beta internally for 1 - 1.5 weeks, but started up some new dev work that seems to be hitting new areas:

Seems that when using expressions in dynamic lists the field alias isn't being generated into the output SQL:


<snip>
            .DefineField(WorkTaskModelFieldIndex.Name, 4, "Name")
<snip>
            Dim nameField As IEntityField2 = fields(4)
            Dim taskExp As New Expression(FactoryClasses.EntityFieldFactory.Create(WorkTaskModelFieldIndex.TaskID), ExOp.Add, ": ")
            nameField.ExpressionToApply = New Expression(taskExp, ExOp.Add, FactoryClasses.EntityFieldFactory.Create(WorkTaskModelFieldIndex.Name))

Output:


exec sp_executesql N'SELECT DISTINCT
<snip> 
([dbo].[WorkTaskModel].[TaskID] + @LO2571) + [dbo].[WorkTaskModel].[Name], 
<snip>
N'@LO2571 nvarchar(4000)', 
@LO2571 = N': '
<snip>

Sorry for snipping the hell out of the string. I can post the whole thing if you want but it's reasonably long and seemingly irrelevant.

If I remove the expression lines the column gets aliased; if I don't the alias is removed.

Jeff...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 25-Oct-2005 08:41:04   

Will look into it.

(edit) reproduced.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Oct-2005 15:19:39   

Fixed in next build.

Workaround: give the alias for the field in ResultsetFields a different name as the fieldname. THis will trigger the code to include the entity alias.

Frans Bouma | Lead developer LLBLGen Pro
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 26-Oct-2005 17:36:41   

Thanks smile