Version:
  1. Script for record reading

    Article: AN0001917 Displayed: 531x

    We can use a simple record reading for some classes (e.g. for master data) according to column 'code'. Such a class has to have a column with code 'code'. When reading data are filetered according to the values in this column.

    In the below example we have class 'project', that contains column 'code', that stores code of each project. The below script reads from the class record with code PROJ30429.

    var dr = OG.DataRow.GetDataRowByCode( null, model.ClassDefs['project'], 'PROJ30429');

    We can read a record in a similar way when we know the value that is contained in another column.  Compared to the previous case we have to add a parameter that is defining code of this column. In our case it is column 'name'.

    var dr = OG.DataRow.GetDataRowByCode( null, model.ClassDefs['project'], 'PROJ30429','name');

    It is possible to read the record also by means of a filter. In the below example we are reading a record again according to the value stored in the column 'name'.

    var f = OG.DataRow.GetDataRowFilter( model.ClassDefs['project'].Id);
     f['name'] = 'PROJ30429';
     var drl = OG.DataRow.GetDataByFilter(f);
     if ( drl != null && drl.Count > 0)
     {
       var dr = drl[0];
     }

  2.    ---
    Your rating:
    Rated by users: 0x
  3. Top
SearchTitle
×