Mass update of limited values

I used to have a process which updated limited values based on a query, but now it seems that it's not working anymore (I assume it's because of version upgrade 8.1.4 -> 9.1).

I also tried to update the limited values with an update clause from Object Browser, but it seems that the values are not updated. This is also something that I have done earlier, so something is changed.

I would really thankful if someone is able to show how I can update those limited values with an process.

Parents
  • At some point in time between v8.1 and v9.1, limited values were moved from a field on DialogColumn to a separate table: QBMColumnLimitedValue. Therefore you need to do your inserts/updates there.
    Code example:

    Private Sub CCC_HandleLimitedValue(UID_Column as String, key As String, Optional description As String = Nothing)
        If Not Session.
                Source().
                Exists(Query.
                From(Table.QBMColumnLimitedValue).
                Where(Function(c) c.Column(Table.QBMColumnLimitedValue.UID_DialogColumn) = UID_Column And c.Column(Table.QBMColumnLimitedValue.KeyValue) = key).
                Exists()) Then
            Dim limitedValue = New QBMColumnLimitedValue(Session) With {
                .UID_DialogColumn = UID_Column,
                .KeyValue = key,
                .KeyDisplay = description
            }
            limitedValue.Save(Session)
        End If
    End Sub
    

  • Thank you!
    It seems that it requires a bit more work  than the old solution, as I would like to have the values in alphabetical order, even after adding a new value there.

  • Maybe you could convert the first few characters to an integer based on their alphabetical position, followed by some padding number, and use that for the OrderNumber? E.g. ABCDE could be 01020300 and ZABC 26010200? That way, you'd have to modify fewer rows whenever you insert, and you can use the two last digits if there are multiple limited values starting with the same three letters

Reply
  • Maybe you could convert the first few characters to an integer based on their alphabetical position, followed by some padding number, and use that for the OrderNumber? E.g. ABCDE could be 01020300 and ZABC 26010200? That way, you'd have to modify fewer rows whenever you insert, and you can use the two last digits if there are multiple limited values starting with the same three letters

Children
No Data