Transfer Value boolean field from one table to another table

gpjgpj Member Posts: 4
Hi There,

I want to transfer the value of a boolean field from the ItemTable to the same boolean field in the SalesLineTable.
(Fieldnumbers are different in both tables)
For instance: when I insert a line in the SalesLineTable it should transfer the value from the Itemtable to the SalesLineTable.

I Put the following code In the OnInsert section in the SalesLineTable:
IF Item.GET("No.") THEN
SalesLineTable.Fieldname := ItemTable.Fieldname;

What am i doing wrong ?

I appreciate your help.

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Is it a typo?

    IF Item.GET("No.") THEN
    SalesLineTable.Fieldname := ItemTable.Fieldname;

    IF Item.GET("No.") THEN
    SalesLineTable.Fieldname := Item.Fieldname;
  • gpjgpj Member Posts: 4
    kapamarou,

    Thanks for your reply.
    I allready found out what went wrong.
    After i confirmed the line in the salesline table (arrow down) the value was tranferred correctly.

    Thanks anyway.
  • SavatageSavatage Member Posts: 7,142
    it's even easier then that. if you look on the onaftervalidate of the "no" field and scrolldown thru the code you will see a number of fields from the item table being transfered ie/description. add your one line of code there. no if get needed.
  • gpjgpj Member Posts: 4
    Ok Harry,

    I also tried your suggestion and I must say this works better then my code.
    I 'll do it your way !

    Thank you too...
Sign In or Register to comment.