On an Item Card Page, there is a selection of Item Category which has a Code field.
I want to print that value for each of the Items selected in the Sales Quote page (Subform, line items area)
So in Sales Quote I have selected 2 items;
1) Front Hub
2) Bicycle
and these two items have a Item Category Code set (lets say Chair, Desk respectively) in their Item Card Page. I will print Chair / Desk in the report of Sales Quote.
I am approaching this be first finding Item Category Codes for the Line Items and then putting them in a variable, then I will compare and move distinct ones (reason for finding distinct is if 2 items have same Item Category Codes I have to print that Code ONLY once, so if 3 Line Items have Desk, Desk, Chair, I will print on the report Desk / Chair) into another array then concatenate the values with ' / ' into a Text Variable.
Here is what I have done so far but got stuck in getting right values into my array.
On the OnAfterGetRecord Trigger of my Sales Quote Report
I have written;
ItemCateTableRec.SetFilter(Code, "Sales Line"."Item Category Code");
IF ItemCateTableRec.FindSet then begin
repeat
myArray[i] := ItemCateTableRec.Code;
i := i + 1;
until ItemCateTableRec.Next = 0;
end;
upon printing the myArray[1] and [2] I do not get the correct Item Category Code Chair or my Item FrontHub and Desk for my Item Bicycle. I get incorrect values.
Thanks a ton in advance for any guidance.