item card new column add can't find in sales invoice forum

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.

Answers

  • Tina_MenezesTina_Menezes Member Posts: 12
    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.
  • bsakareembsakareem Member Posts: 4
    Adding to item card hsncode new field, will auto pick relevant hsncode when product is selected. how to link item hsncode to sale invoice form?
  • Tina_MenezesTina_Menezes Member Posts: 12
    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;
  • bsakareembsakareem Member Posts: 4
    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.
  • Tina_MenezesTina_Menezes Member Posts: 12
    Hi, there must be some issue in your code. Kindly post your code and the trigger under which you have written it.
  • NeerajNeeraj Member Posts: 15
    Hi,
    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
  • Tina_MenezesTina_Menezes Member Posts: 12
    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.
Sign In or Register to comment.