Ambiguous Column Error - Editor 2.4.1 Options

Ambiguous Column Error - Editor 2.4.1 Options

ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 66Questions: 17Answers: 2

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

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 66Questions: 17Answers: 2

    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?

  • allanallan Posts: 64,010Questions: 1Answers: 10,554 Site admin

    Sounds like I need to add in some de-duplication for the fields there. Thanks for letting me know about that.

    Allan

  • allanallan Posts: 64,010Questions: 1Answers: 10,554 Site admin
    Answer ✓

    Fix committed in here. It will be in Editor 2.4.2.

    Thanks for brining this one to my attention,
    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 66Questions: 17Answers: 2

    Quick and efficient as always :smile:

    Thanks @allan

Sign In or Register to comment.