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?
0
Answers
My number one suggestion is to write code in the Page 46: No. - OnLookup trigger.
Good luck.
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);
I miss one line of code to store the selected value, something like:
"Sales Line"."No." := recItem."No.";
Good luck