Inserting into Table With code

mo_xmo_x Member Posts: 50
Hey,
I'm trying to insert a new sales Line programmatically. However, I'm a bit lost on where should the code be written. I tried on Onvalidate trigger for No field.
and Oninsert trigger. But neither of those two worked. I used setrange, init, and some fields, but nothing happened.

Best Answer

Answers

  • AntoniomvallsAntoniomvalls Member Posts: 34
    Try it on a new report or codeunit. Report with an integer dataitem filtered by number = how many lines u want

    document no., line no. document type insert
    etc
    etc
    etc
    modify;
    Giving thanks is always wellcome
  • mo_xmo_x Member Posts: 50
    You right, i could try it on report. but i want to insert new sales line when creating sales order.

    when salesline1 is created.
    then automatically salesline2 should be inserted.
    it should have the same values as salesline1, but only number should be different: For example:
    no. 1000
    no.1100 < new line.
  • AntoniomvallsAntoniomvalls Member Posts: 34
    but the data refresh only works if u can say what is the line objective. and that u can only know at the moment of creation.

    Moreover u have to think that if u make automatically u can be modifying the functionality of the standard in ways u dont want
    Giving thanks is always wellcome
  • AntoniomvallsAntoniomvalls Member Posts: 34
    add a button in the subform, not in the main page. (put it in page/form 46 not in 42)
    Giving thanks is always wellcome
Sign In or Register to comment.