Using unique-identifier in simple queries

Using unique-identifier in simple queries

  
Just wanted to make sure that as of version 8.0.1.20, to use uniquer identifier column as a filtering column, one need to use advanced queries (like (convert(nvarchar(50), {entityName}.columnName) = @Textvariable))) and it is not possible in simple queries. Is this assumption correct  or is there a way to use it in simple queries ?

Regards
Hi kota,

You should be able to filter the column in Simple Queries using the same strategy: EntityRefTextToText(EntityName.ColumnName) = TextVariable. Do you get any error or does it work ok?

Regards,
Paulo Ferreira
HI Paulo, 
              What if the Column Name is not of type entity ref, you can not use this function then. This column is a primary key of a table from another server (hence is part of another extension). Let me know if this make sense. 

Regards
Hi kota,

Given your advanced query snippet, I assumed that ColumnName was indeed a primary key and that it is of type Text. If that's not the case, what is the type of ColumnName? (inside Service Studio)

Regards,
Paulo Ferreira
Also, when you say "it is not possible", do you mean you get an error inside Service Studio, or is it in the running application?

Regards,
Paulo Ferreira
It is of type text (50). 
I get the following error at run time "Conversion failed when converting from a character string to uniqueidentifier."
I was able to reproduce the problem in 7.0. Did you have it working with a Simple Query previous to 8.0.1.20?

Regards,
Paulo Ferreira
no never. I have always used it in advanced queries.
I've researched a little more and the use of uniqueidentifier columns is not officially supported, so you do need to use an Advanced Query for this scenario.

Regards,
Paulo Ferreira
Thanks Paulo, Just wanted to confirm it. Is it supported in version 9 ? 
No, I checked and it does not work in version 9 either. Since in the extension the column is (manually) configured as having type Text, we don't perform any casts when comparing with other Text values.

Regards,
Paulo Ferreira