Form 54

In purchase line I want to know where is the instruction to fiil de description item automatically.

When I create a new purchase line, I put the item No. and automaticaly the description item is filled. Where is this instruction defined, I want to do that on a different field, where and how can i do it?


You are looking in the wrong place - The code that does this is on the OnValidate trigger of the No. field in the Purchase Line table (Table 39).

If you can access the code you can change it from here, but I would be incline to see if there is another way to achieve what you want - I am not sure why you might want this change - If it is for translations, alternative descriptions etc I would first look at implementing Translations, Extended Texts or the Item Vendor Catalogue (Contains the option to have a “Vendor’s description”).

Or look at using the Description 2 field in some way…

Thanks for your help, but what i pretend is:

I created a new field in Item table, and this field is directly related with item No…

I created the same field in purchase line table to.

So, when I insert a new purchase line, when I insert item No. I would like to have this new field automaticaly filed with the value that item table has.

Here is the reason to my first unswer.


Whenever you see behavior that you want to copy elsewhere, you turn the debugger on, and you trace the code to see what it does, and where the code is written. What you are talking about is validation code, and it should be written in the OnValidate trigger of the table’s field.

You NEVER write code like that on the form. By writing the code in the table trigger, it will behave the same on every form.


I agree entirely with Daniel’s comments here.