Retrun value

hi everyone,

can you please help me to find out how can i compare the first 3 items lines in a Invoice, return the ‘Unit Of Measure Code’ and present the first line in order of the “Line No.”.
i already knew that the 3 lines are like this.

i just need an example Code.

Fields : Line No. P.Key Type Unit of Measure Code

10000 Item STÜCK
20000 Item STUNDE
30000 Item STÜCK

RECORD : SalesInvLine T113

it will be very helpfull.
thank you in advance for making time to read this.
Best regards,
Ayoub

Hi,
What is condition to get ‘Unit of measure code’ after compare lines.

Hi Ayoub,

If you Know the Concepts of Arrays Then i would Provide Solution.

is there no solution without using Arrays?
i unfortunately don’t know the concepts

ok then

i would Simplify it your Concept then

Do you Know Cases i.e Conditional Statements in nav if No Click Here

SalesInvLineL.RESET;

SalesInvLineL.SETRANGE(SalesInvLineL.“Document No.”, pDocumentNo);

IF SalesInvoiceLineG.FINDSET THEN BEGIN
REPEAT

CASE SalesInvoiceLineG.“Unit of Measure Code” OF
Code1L :
BEGIN

Count1L := Count1L + 1;

End;

Code2L :
BEGIN

Count2L := Count2L + 1;

End;

UNTIL SalesInvoiceLineG.NEXT =0;
END;

//highcount int variable

IF Count1L >= Count2L then

OutputCode := Code1L

Else

OutputCode := Code2L;

Hi,
Did you find solution to the problem?

thank you all :slight_smile: works