In nav 5.0 item card table i have added hsncode new column, but it's can't in the new columne under field colums of sales invoice form. Please advise how to add in sale invoice form.
Hi,
If you want your new field 'hsncode' to be visible on your Sales invoice form, you have to add this new field in your sales header because 'sales header' is the base table of 'sales invoice' page.
Hi,
Ok your question was not clearly framed before. Now it is clear.
So your Hsncode has to be added in Itemtable and SalesLineTable too.
I believe you are entering the hsncode in Item table.
Now you have to link your sales line table and item table.
You can add below code in OnValidate trigger of your No. field of Sales Line table.
ItemTable.reset;
ItemTable.setrange(No.,SalesLineTable.No.);
If ItemTable.findfirst then begin
SalesLineTable.hsncode:=Itemtable.hsncode;
SalesLineTable.modify(true);
end;
Thanks for reply, but it's not retrieving the data from item card . i have added new fileds in both items and sales line. From item card menu i have insert the hsncode from product no. In sales invoice forum, added above code in No_ onvalidate trigger.
Hi,
Is your issue resolved?
Alternatively in the OnValidate trigger of 'No' field of your sales line table and under the switch-case statement, under Type::Item:
you can retrieve your hsn code field value from Item table to your field value of sales line.
//The below two statements are already present.
Description := Item.Description;
"Description 2" := Item."Description 2";
//new code to be added
HsnCodeField :=Item.HsnCode;
where HsnCodeField is present in your sales line table and HsnCode is in Item table.
Answers
If you want your new field 'hsncode' to be visible on your Sales invoice form, you have to add this new field in your sales header because 'sales header' is the base table of 'sales invoice' page.
Ok your question was not clearly framed before. Now it is clear.
So your Hsncode has to be added in Itemtable and SalesLineTable too.
I believe you are entering the hsncode in Item table.
Now you have to link your sales line table and item table.
You can add below code in OnValidate trigger of your No. field of Sales Line table.
ItemTable.reset;
ItemTable.setrange(No.,SalesLineTable.No.);
If ItemTable.findfirst then begin
SalesLineTable.hsncode:=Itemtable.hsncode;
SalesLineTable.modify(true);
end;
If you have created fields in Item table and Sales line then
go to Sale Line table. Check for below code in on Validate() of No. Field
GetItem;
Item.TESTFIELD(Blocked,FALSE);
Item.TESTFIELD("Gen. Prod. Posting Group");
//New Code
HsnCode:=Item.hsncode;
// New Code
IF Item.Type = Item.Type::Inventory THEN BEGIN
Item.TESTFIELD("Inventory Posting Group");
"Posting Group" := Item."Inventory Posting Group";
END;
Description := Item.Description;
Regards,
Neeraj Singh
Is your issue resolved?
Alternatively in the OnValidate trigger of 'No' field of your sales line table and under the switch-case statement, under Type::Item:
you can retrieve your hsn code field value from Item table to your field value of sales line.
//The below two statements are already present.
Description := Item.Description;
"Description 2" := Item."Description 2";
//new code to be added
HsnCodeField :=Item.HsnCode;
where HsnCodeField is present in your sales line table and HsnCode is in Item table.