How to retrieve column values from one table to another table

I have added QC Item boolean field in Item table as well as in purchase line table. If suppose QC Item field is selected in item table, In purchase line QC Item field value should get selected automatically .

Welcome To DUG!!!

Write a code on Validate Trigger of No. field in Purchase line table .

I have added following code on Validate trigger of No. Field where ItemRec is record variable created for item table. but this is not working… Tell me correct code for it.

IF ItemRec.“QC Item”=TRUE THEN

“QC Item”:=TRUE;

Do you know how the Item Description is copied in Sales Line and Purchase Lines?

Check the existing tables and code.

I am very new to navision. i am not understanding your talking about which code. I search in Item table but there is no field with the name Item Description. Can you guide me properly.

Please contact your senior in office to provide you the training on NAV.

Read NAV Technical documents


As suggested by Mohana, please read Nav Technical documents and try to learn by yourself.

When you opened OnValidate trigger of No. in sales line table, there is code written for Type:Item.

Here various fields are being copied from item table to sales line table. Write your code here and this will work.

I took example of sales line table instead of purchase line. But don’t worry, both are same.

Hi Sheetal, if you don’t mind, I just wanted to make a quick observation about the code sample you gave earlier. It’s this …

IF ItemRec.“QC Item”=TRUE THEN
“QC Item”:=TRUE;

So, what happens to the value of “QC Item” on the Sales Line record if the user initially picks an Item No. for which “QC Item” is true in the Item record, and then later changes the “No.” value on the same sales line to a different Item record, one for which the value of “QC Item” is false? The most common scenario for this type of change might be that the user initially entered the wrong Item No., something like that. They way you have your code now, the value of “QC Item” on the sales line would still be true, because you’re only assigning a value if the “QC Item” field in the Item record is true.

An easy way around that would be something like …

“QC Item” := Item.“QC Item”;

With this code, you save yourself (the computer, actually) from having to inspect the value of the “QC Item” field in the Item record before assigning the value to the field in the sales line. And you’re also covered if the user picks a different item number.

And, when you’re inspecting or testing the value of a field or variable that is defined as a boolean, you don’t have to write IF BooleanVariable = TRUE THEN, or IF BooleanField = FALSE THEN, you just write IF BooleanVariable THEN. It has the same effect and saves you a lot of typing.

I hope that’s helpful.

Hi , Please read the training manual, and the examples !