Options

how to display the list of items in the SO line based on dimension selected in header

I have created global dimension 1 code which have dimension values that represents the products that are sold by the company.All the items have been already assigned with their corresponding default dimension value code which represents their product group.Now when a sales order is created,firstly the product code is selected which is a global dimension 1 code in a header.Now,When I select the item type and use dropdown to select the item in No. field.There should only be the list of the products that belongs to that product code.For e.g;-
if there are two values of the product code dimension like 'Laptop' and 'Mobile'.
So,When I select as Laptop in the sales order header,the line item should display only the list of laptops that are present in the item list.
Now,How can I solve this requirement?

Answers

  • Options
    Peter+is1Peter+is1 Member Posts: 174
    Hi,

    My number one suggestion is to write code in the Page 46: No. - OnLookup trigger.

    Good luck.
    \\
    The truth exists in seven versions.
  • Options
    Wrote the code in No.-OnLookUp() but it didnt work.So,I placed the code in the sales line table in No.-OnLookUp(),it kinda worked but when I select the item it did not select the item value.Here's the code I wrote:-

    IF Type = Type::Item THEN BEGIN
    SalesHeader.SETRANGE("No.","Document No.");
    IF SalesHeader.FINDFIRST THEN BEGIN
    recItem.SETRANGE("Global Dimension 1 Code",SalesHeader."Shortcut Dimension 1 Code");
    IF recItem.FINDSET THEN BEGIN
    ItemList.SETRECORD(recItem);
    ItemList.SETTABLEVIEW(recItem);
    ItemList.LOOKUPMODE(TRUE);
    IF ItemList.RUNMODAL = ACTION::LookupOK THEN
    ItemList.GETRECORD(recItem);
    END;
    END;
    END;
    CLEAR(ItemList);
  • Options
    Peter+is1Peter+is1 Member Posts: 174
    Hi,

    I miss one line of code to store the selected value, something like:
    "Sales Line"."No." := recItem."No.";


    Good luck
    \\
    The truth exists in seven versions.
Sign In or Register to comment.