bug 5.0

BeliasBelias Member Posts: 2,998
i found this in codeunit 12/UnapplyCustLedgEntry(GenJnlLine2,DtldCustLedgEntry)
function
GenJnlLine.TRANSFERFIELDS(GenJnlLine2);
IF GenJnlLine."Document Date" = 0D THEN
  GenJnlLine."Document Date" := GenJnlLine."Posting Date";

InitCodeUnit;

IF Cust."No." <> DtldCustLedgEntry."Customer No." THEN
  Cust.GET(DtldCustLedgEntry."Customer No.");
Cust.CheckBlockedCustOnJnls(Cust,0,TRUE);

Cust.TESTFIELD("Customer Posting Group");
CustPostingGr.GET(Cust."Customer Posting Group");
CustPostingGr.TESTFIELD("Receivables Account");

VATEntry.LOCKTABLE;
DtldCustLedgEntry.LOCKTABLE;
CustLedgEntry.LOCKTABLE;

DtldCustLedgEntry.TESTFIELD("Entry Type",DtldCustLedgEntry."Entry Type"::Application);

DtldCustLedgEntry2.RESET;
DtldCustLedgEntry2.FINDLAST;
NextDtldLedgEntryEntryNo := DtldCustLedgEntry2."Entry No." + 1;
DtldCustLedgEntry2.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
//////This one
DtldCustLedgEntry2.ASCENDING(FALSE);
//////This one
DtldCustLedgEntry2.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.");
DtldCustLedgEntry2.SETRANGE("Customer No.",DtldCustLedgEntry."Customer No.");
DtldCustLedgEntry2.SETFILTER("Entry Type",'>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");
//////This one
DtldCustLedgEntry2.FINDSET;//////This one


the //////This one lines, are conflicting, as findset can't be used for descending orders. Currently i've not got a 5sp1 to view, does someone know if this thing solved in the service pack?
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • kinekine Member Posts: 12,562
    SP1 part of the same part:
    GenJnlLine.TRANSFERFIELDS(GenJnlLine2);
    IF GenJnlLine."Document Date" = 0D THEN
      GenJnlLine."Document Date" := GenJnlLine."Posting Date";
    
    InitCodeUnit;
    
    IF Cust."No." <> DtldCustLedgEntry."Customer No." THEN
      Cust.GET(DtldCustLedgEntry."Customer No.");
    Cust.CheckBlockedCustOnJnls(Cust,0,TRUE);
    
    CustPostingGr.GET(GenJnlLine."Posting Group");
    CustPostingGr.TESTFIELD("Receivables Account");
    
    VATEntry.LOCKTABLE;
    DtldCustLedgEntry.LOCKTABLE;
    CustLedgEntry.LOCKTABLE;
    
    DtldCustLedgEntry.TESTFIELD("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
    
    DtldCustLedgEntry2.RESET;
    DtldCustLedgEntry2.FINDLAST;
    NextDtldLedgEntryEntryNo := DtldCustLedgEntry2."Entry No." + 1;
    DtldCustLedgEntry2.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
    DtldCustLedgEntry2.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.");
    DtldCustLedgEntry2.SETRANGE("Customer No.",DtldCustLedgEntry."Customer No.");
    DtldCustLedgEntry2.SETFILTER("Entry Type",'>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");
    DtldCustLedgEntry2.FINDSET;
    REPEAT
      DtldCustLedgEntry2.TESTFIELD(Unapplied,FALSE);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • BeliasBelias Member Posts: 2,998
    :shock: :bug: :shock:

    OK! Thanks a lot!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.