Anyone else experiencing this?:
I have a grid based on a MSSQL 2012 View, with a search part that is failing on all three fields in the search.
One example is searching for integer-type field name SAMPLE_NUMBER. I've turned on debugging and "Show query statements", and when I search for Sample_number 4, for instance, no records are found, and this is displayed:
SELECT FIRST 21 Sample_Number, Test_Type_ID, Test_Type, Animal_Name, Sample_DateTime, Void FROM Medical_Sample_Exam_Animal_View WHERE Sample_Number = :Sample_Number ORDER BY Sample_Number DESC
This suggests to me that Alpha thinks SAMPLE_NUMBER is a logical field.
I look in the template Xbasic, and sure enough, I have this:
.portableType = "Integer32"
.nativeType = "int"
.Type = "L"
Another field - ANIMAL_NAME should be Character, but it has this:
.portableType = "NationalVaryingCharacter"
.nativeType = "nvarchar"
.Type = "L"
But I see in the tmpl part for Grid fields (as opposed to those for the Search part) the values are correct for ANIMAL_NAME:
.portableType = "NationalVaryingCharacter"
.nativeType = "nvarchar"
.Type = "C"
I compared this against other grids with searches and found what I would expect -- a character-type field is set for Type = "C" and so on.
For a work-around I'm trying to set the type in the OnGridInitialize but so far even that's not very happy.
Any thoughts?
Addendum: This isn't changing anything either -- completely stuck with no way to search, and don't even know how to intercept this with something like the OnSearchPartFilterCompute:
I have a grid based on a MSSQL 2012 View, with a search part that is failing on all three fields in the search.
One example is searching for integer-type field name SAMPLE_NUMBER. I've turned on debugging and "Show query statements", and when I search for Sample_number 4, for instance, no records are found, and this is displayed:
SELECT FIRST 21 Sample_Number, Test_Type_ID, Test_Type, Animal_Name, Sample_DateTime, Void FROM Medical_Sample_Exam_Animal_View WHERE Sample_Number = :Sample_Number ORDER BY Sample_Number DESC
:sample_number (L) | False |
I look in the template Xbasic, and sure enough, I have this:
.portableType = "Integer32"
.nativeType = "int"
.Type = "L"
Another field - ANIMAL_NAME should be Character, but it has this:
.portableType = "NationalVaryingCharacter"
.nativeType = "nvarchar"
.Type = "L"
But I see in the tmpl part for Grid fields (as opposed to those for the Search part) the values are correct for ANIMAL_NAME:
.portableType = "NationalVaryingCharacter"
.nativeType = "nvarchar"
.Type = "C"
I compared this against other grids with searches and found what I would expect -- a character-type field is set for Type = "C" and so on.
For a work-around I'm trying to set the type in the OnGridInitialize but so far even that's not very happy.
Any thoughts?
Addendum: This isn't changing anything either -- completely stuck with no way to search, and don't even know how to intercept this with something like the OnSearchPartFilterCompute:
Code:
e.tmpl.searchfield_info[1].Type = "N" e.tmpl.flagMustRecalculateAllProperties = .t.