To insert a single Line Record in a table from C/AL, AL is done by using Insert function but to insert more then one line is little different because in this condition you need to change the primary key so the below code is the solution to insert multiple line record.
//Rec is a record variable
IF Rec.FINDLAST THEN Rec.PrimaryKey := Rec.PrimaryKey + 3; // This line code will find the last no and will increase by 3 Rec.name:= 'First line'; Rec.INSERT(TRUE); Rec.FINDLAST; Rec.PrimaryKey := Rec.PrimaryKey + 3; Rec.name:= 'Secsond Line'; Rec.INSERT(TRUE);