Hello,
I'm developing a plugin, and I'm in need of having the bugQuery.AddOrderBy() in the GridColumnSortQuery() return a different number depending on the Bug.ixCategory (yes, it's for one column).
My SQL statement is correct, but FogBugz does some checking of the SQL string argument that is passed in to bugQuery.AddOrderBy() (or any of the methods actually) and complains at runtime that the syntax is not correct.
The code is something like:
public CBugQuery GridColumnSortQuery(CGridColumn col,
bool fDescending, bool fIncludeSelect)
...
bugQuery.AddOrderBy(String.Format(
@"CASE WHEN Bug.ixCategory = 5
THEN {0}.{1}*{2}.{1}
WHEN Bug.ixCategory = 1
THEN {3}.{1}*{4}.{1}
END {5}",
api.Database.PluginTableName(TABLE1_NAME),
FIELD_NAME,
api.Database.PluginTableName(TABLE2_NAME),
api.Database.PluginTableName(TABLE3_NAME),
api.Database.PluginTableName(TABLE4_NAME),
(fDescending ? "DESC" : "ASC")
) );
Anyone has any thoughts on this? Wild thinking here, is there a way to make FogBugz not check for the arguments and let the string go through?
thanks!