How to add Lot No. field from Item Ledger Entry table into Report ?What C/al coding for that?

mdsrmdsr Member Posts: 163
i have taken item ledger entry table as record variable in report.
RecILE.RESET;
RecILE.SETRANGE("Document No.","Purch. Rcpt. Line"."No.");
IF RecILE.FINDFIRST THEN
LotNo:=RecILE."Lot No.";

Answers

  • midegomidego Member Posts: 51
    You don't have a GET in your code.
  • mdsrmdsr Member Posts: 163
    Hi midego, i have added get in code it still not giving output
    RecILE.RESET;
    RecILE.GET();
    RecILE.SETRANGE("Document No.",RecILE."Document No.");
    RecILE.SETRANGE("Item No.","Purch. Rcpt. Line"."No.");
    IF RecILE.FINDFIRST THEN
    LotNo:=RecILE."Lot No.";

    now it giving error while running report:
    error:the item Ledger Entry does not exist.identification and values Entry No.='0'
  • mdsrmdsr Member Posts: 163
    I used following code and it works it prints Lot No.
    RecILE.RESET;
    RecILE.SETRANGE("Document No.","Purch. Rcpt. Line"."Document No.");
    RecILE.SETRANGE("Item No.","Purch. Rcpt. Line"."No.");
    IF RecILE.FINDFIRST THEN
    LotNo:=RecILE."Lot No.";
  • sorenhinrupsorenhinrup Member Posts: 136
    This will work, but only if you only have 1 lot no. per Purchase reciept line.
  • mdsrmdsr Member Posts: 163
    Exactly sir, Now I am facing problem It prints only one lot No. But I want to print multiple lot No.
    Suppose item consuming 50kg out of 100 kg from lot no 1 and 50 kg from lot No.2
    Now questions is that how to print both lot No. in report what C/AL code for that please help
    Thanks in advance
  • sorenhinrupsorenhinrup Member Posts: 136
    I believe you can do it by adding another element on your report dataset. Datasource RecILE, and FILTER as you have previously.
    Then you can add another repeater element on your report with the RecILE and lotnumbers.
  • mdsrmdsr Member Posts: 163
    Sir,I didn't get what exactly you trying to say.
    Adding recILE in data source give me following error:
    'Record' is not valid column type
  • DuikmeesterDuikmeester Member Posts: 308
    You will have to build a dataitem like this: kbdcgs68houl.png. Then you can print multiple lot numbers per purchase receipt.
  • mdsrmdsr Member Posts: 163
    Hi sir, added dataitem ILE and column Lot No.
    How adding dataitem ILE and column Lot No. gives multiple lot No.in report.
    RecILE.RESET;
    RecILE.SETRANGE("Document No.","Purch. Rcpt. Line"."Document No.");
    RecILE.SETRANGE("Item No.","Purch. Rcpt. Line"."No.");
    //IF RecILE.FINDFIRST THEN
    //LotNo:=RecILE."Lot No.";
    IF RecILE.FINDSET THEN
    REPEAT
    LotNo:=RecILE."Lot No.";
    UNTIL RecILE.NEXT=0;

    Is it right for multiple lot no.
  • DuikmeesterDuikmeester Member Posts: 308
    No need for additional code. You just map Lot No. on your layout.
Sign In or Register to comment.