Ambiguous Column Error - Editor 2.4.1 Options
Ambiguous Column Error - Editor 2.4.1 Options

in Editor
I have the following simple options code. In this case, the backend table Primary ID is the label since it's a simple list:
editor.Field(new Field("Property.State").Options(new Options().Table("State").Value("StateCode").Label("StateCode")));
When running the code in 2.4.1 it returns an Ambiguous column error:
This makes sense given the query used in the debug is:
SELECT DISTINCT [StateCode] as 'StateCode', [StateCode] as 'StateCode' FROM [State] ORDER BY [StateCode] asc
However, prior to 2.4.1, in 2.3.2 it returned the following query:
SELECT DISTINCT [StateCode] as 'StateCode', [StateCode] as 'StateCode' FROM [State]
Since there was no ordering, this wasn't an issue.
What's the best way to address this?
This question has an accepted answers - jump to answer
Answers
I just found that you can disabled ordering in the docs using .Order(false).
But let's say we wanted to have it do the ordering?
Sounds like I need to add in some de-duplication for the fields there. Thanks for letting me know about that.
Allan
Fix committed in here. It will be in Editor 2.4.2.
Thanks for brining this one to my attention,
Allan
Quick and efficient as always
Thanks @allan