How to insert new record in table while modifying in form

gopalngopaln Member Posts: 5
Dear All
I have a problem in inserting a new line in my created table. In card form, if they modify any fields, new line (records) should come in my created table, both table and card form are simple objects only. first they will enter some records, it will automatically get inserted, then if they modify, new line should be formed in my table

Pls give ur views!

Thanks

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi,

    I would put codeto insert new records in the OnInsert & OnModify of the source table that you are using for the form.

    eg. if you are using Customer form then on the triggers metioned abopve you would add the code in Table 18
    OnInsert

    MyTable."no." := "No.";
    MyTable."Line No." := 1;
    MyTable.INSERT;

    OnModify

    MyTable.setrange("No.","No.");
    IF MyTable.FINDLAST THEN
    LineNo := MyTable."Line No.";
    LineNo := LineNo + 1;
    MyTable."no." := "No.";
    MyTable."Line No." := LineNo;
    MyTable.Name := Name;
    etc
    MyTable.Insert;


    Hope this helps

    Albert
  • gopalngopaln Member Posts: 5
    Thanks for ur reply!\

    here Mytable refers to what?

    Is that the record variable for my created table??

    Thanks
  • garakgarak Member Posts: 3,263
    why do you need this? Need you a "historial log"?
    Do you make it right, it works too!
Sign In or Register to comment.