1. Create and save data into a class

    Article: AN0001859Updated:

    This example creates a new record and saves it into class ID 100.

    var drNew = OG.DataRow.CreateNew( 100);
    drNew.SetText( 30, 'name');
    OG.DataRow.SaveData( drNew);

    This example creates a new record in the current model in class 'find-text'and inserts values in three columns.

    var cl = OG.ClassDef.GetByCode( OGModel.Id, 'find-text');
    var dr = OG.DataRow.CreateNew(cl.Id);
    dr['text'] = 'My_text';
    dr['find-user'] = OG.Person.GetLoginPerson().ToPersonInfo();
    dr['language'] = OG.GetActualLocalize();
    OG.DataRow.SaveData(dr);

×