1. Ordering texts with special format

    Article: AN0002405Updated: 01.12.2019

    In some cases we need to order texts in another way than a simple ordering of common texts. There are cases when we use a special fomat but we want to order according to values corresponding to texts. In such cases we can create a column of Decimal type with values corresponding to the text and update it by means of rules After new and existing record save. We then order by this column.

    Ordering IP addresses

    Example: Script in rules after new and existing record save (we use in the class column ip of type Text, which is updated by user, and column ip_sort of type Decimal, which is updated automatically by a corresponding decimal value).

    var ip = OGActualDataRow['ip'];
    if ( ip != null && ip != '')
    {
    var dt = OG.TextUtils.CreateDottedText(4, 4, 3);
    OGActualDataRow['ip_sort'] = System.Convert.ToDecimal( dt.ParseLong( ip));
    }

     

×