Hi,
I created an extra field in purchase order lines called 'Web Model Number' which is an extra custom field on the 'Items' table.
It works OK generally, getting filled when I select an item.
I also added some code to lookup the item No. so I could just paste the web model number into the purchase order. (below)
field(50110; "Web Model Code"; Code[50])
{
Caption = 'Web Model';
DataClassification = ToBeClassified;
trigger OnValidate() // This is the trigger that will be called when the field is validated and fills Web Model Code
var
Item: Record Item;
begin
if "Web Model Code" <> '' then begin
Item.SetRange("Web Model", "Web Model Code"); // Set the range to the value in the field
if Item.FindFirst()then begin
Validate("No.", Item."No.");
"Web Model Code":=Item."Web Model";
end
else
"Web Model Code":=''; // Clear the field if no item is found
//
end;
end;
}
THE ISSUE:
If I paste the model number it correctly selects the Item 'No.' and fills the Item 'Description' but the 'Direct Unit Cost Excl VAT' field is not filled.
If I select an item in the normal way it correctly fills 'Direct Unit Cost Excl VAT' with the last price.
Any ideas?