Announcements
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);
*This post is locked for comments
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156