Issue in form

Hi,

I am designing a form, designing it as a dash board. I have not set any table as the source table for this form. I have used a ComandButton. If I click the commandbutton the form shows values. Have written the code in OnPush() of the CommandButton. If I take a single record variable as a table its showing proper values but if I link it to another record variable its not displaying any value. What may be the possible reason for this? Can anyone help me…

This is the code I have written,

RhyHexQ := 0;
RhyHexV := 0;
recILE.RESET;
recILE.SETFILTER(recILE.“Location Code”,’%1|%2’,‘ST-PKT01’,‘ST-PKT02’);
recILE.SETFILTER(recILE.“Item Category Code”,‘PM’);
IF recILE.FINDFIRST THEN
BEGIN
recItem1.RESET;
recItem1.SETRANGE(recItem1.“No.”,recILE.“Item No.”);
recItem1.SETFILTER(recItem1.“Product Group Code”,‘RHYTHM’);
recItem1.SETFILTER(recItem1.“Sub Category 3”,‘HEXA’);
IF recItem1.FIND(’-’) THEN
BEGIN
REPEAT
recItem1.CALCFIELDS(Inventory);
RhyHexQ += recItem1.Inventory;
RhyHexV += recItem1.Inventory * recItem1.“Unit Cost”;
UNTIL recItem1.NEXT = 0;
END;
END;

If I run only with the Item table its doing fine but if I link it with ILE its showing zero.

Have you tried to filter the data in the table first rather than checking the code.

Hi,

You are only looking a one ILE record and the Item for that record .

The loop of the item record will only execute once as you only have one item.

Shoud the loop not be on the ILE table?

why u r using ILE for filtering location. There is a filed location filter in the Item card use that one.

Hi Change the code as below :

RecItem1.RESET;

RecItem1.SETFILTER(“Location Code”,’%1|%2’,‘ST-PKT01’,‘ST-PKT02’);
RecItem1.SETFILTER(“Item Category Code”,‘PM’);
RecItem1.SETFILTER(“Product Group Code”,‘RHYTHM’);
RecItem1.SETFILTER(“Sub Category 3”,‘HEXA’);
IF RecItem1.FINDFIRST THEN REPEAT
RecItem1.CALCFIELDS(Inventory);
RhyHexQ += recItem1.Inventory;
RhyHexV += recItem1.Inventory * recItem1.“Unit Cost”;
UNTIL recItem1.NEXT = 0;