Posted Purchase Receipt with No ILE or VE?

jversusjjversusj Member Posts: 489
I searched the forum and found only questions regarding Undo receipt and adjust cost.

here's my observation. I have a Purchase Order that will not post. I get the error message:

Microsoft Dynamics NAV
Item Ledger Entry Entry No. '0' does not exist.

OK

When i activate debugger, i find that the code stops in Codeunit 22 on a GloablILE Variable GET. I don't want to lock users out while i painstakingly watch the posting process through debugger, so i began investigating the documents and entries in the system. for this PO, i do have a Posted Purchase Receipt, but when i navigate on that PPR, i see no Item Ledger Entry or Value Entry. When i look at the item ledger entries for this item, i see no "Purchase" type entries, only positive/negative adjustments. the PO line does show Qty received and Qty to Invoice.

anybody seen this type of snafu before? any tips for resolving so we can post the PO? Note that the vendor is not charging us for this - we are trying to post the PO for $0.

thanks in advance!
kind of fell into this...

Answers

  • DenSterDenSter Member Posts: 8,304
    A variable called "GloablILE" is not part of standard code, so that must be a customization. Not that I've never made a typo in variable naming, but the fact that the typo is still in there is evidence that the developer did not feel like correcting that mistake, which to me is a troubling sign.

    Looking at the error message, it looks like it is trying to GET a record that does not exist. Looking at the value 0 in there, it looks like it doesn't know the entry number. I'd try to figure out what this custom code is supposed to do, which entry it is trying to retrieve from the system, and make sure the right one is used in the GET.
  • jversusjjversusj Member Posts: 489
    sorry for the bad typo...

    here is the actual code from Codeunit 22 Item Jnl.-Post Line\PostItem().
      IF (Quantity <> 0) AND
         ("Item Charge No." = '') AND
         NOT ("Value Entry Type" IN ["Value Entry Type"::Revaluation,"Value Entry Type"::Rounding]) AND
         NOT Adjustment
      THEN
        ItemQtyPosting
      ELSE BEGIN
        IF ("Invoiced Quantity" <> 0) OR Adjustment THEN BEGIN
          IF "Value Entry Type" = "Value Entry Type"::"Direct Cost" THEN
            GlobalItemLedgEntry.GET("Item Shpt. Entry No.")                            //the code is breaking here
          ELSE
            GlobalItemLedgEntry.GET("Applies-to Entry");
          InitValueEntry(GlobalValueEntry,GlobalItemLedgEntry);
        END;
      END;
    
    this same code appears in a Cronos db i have installed, so i do not think it is a mod. again, apologize for the poor typing skills!
    kind of fell into this...
  • DenSterDenSter Member Posts: 8,304
    Ah it was your typo in here instead of a typo in the code :mrgreen:

    If you can reproduce the error in standard Cronus then you might have found a bug, or at least one of those errors that doesn't mean anything to the user. Where it says GlobalItemLedgEntry.GET("Item Shpt. Entry No.") it is trying to retrieve an item ledger entry with the value of the "Item Shpt. Entry No." field, I'm assuming to link the entry that it's building to that entry. Usually this points to an underlying problem where the journal line that is built for this process is missing some information.

    What process are you running there? Is any of it part of a custom process, or is any of it modified?
  • ara3nara3n Member Posts: 9,255
    The code has changed in 2009 Sp1 to this

        IF ("Invoiced Quantity" <> 0) OR Adjustment OR
           IsInterimRevaluation
        THEN BEGIN
          IF "Value Entry Type" = "Value Entry Type"::"Direct Cost" THEN
            GlobalItemLedgEntry.GET("Item Shpt. Entry No.")
          ELSE
            GlobalItemLedgEntry.GET("Applies-to Entry");
          InitValueEntry(GlobalValueEntry,GlobalItemLedgEntry);
        END;
    

    I suggest to test your scenario in 2009 Sp1 and if you are on 5.0 version do an exe upgrade to classic and merge the objects.

    You could also change take that code snippet and IsInterimRevaluation function and apply it to your version.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jversusjjversusj Member Posts: 489
    @denster
    no sir, this is a pretty standard process and i do not _think_ it has been modified (our system has lots of mods, but i don't think a lot regarding purchases and receipts). we just want to post the purchase invoice (Post > Invoice Only). there is no underlying item ledger entry or value entry, which i think is leading to this error. My question is mainly, what can we do to get rid of this PO? It shows as an outstanding PO since the Qty Received > 0 and Qty Invoiced = 0. i cannot delete the PO because Qty Received not invoiced is not 0. i cannot invoice because i get this error. i am stuck in a catch 22! :?

    i'm pretty sure the real problem here occured during the posting of the receipt (which was months ago). The vendor never invoiced us for the product, so accounting is trying to simply close the PO and get it off the books. somehow the Posted Purchase Receipt was created, but not the ILE or VE that should accompany it.

    nobody else has ever seen an incomplete PPR?

    @ara3n
    we are on 3.7b code base, 5.0 executables. I do not have access to nav2009 sp1 at this time. further, i cannot recreate the scenario where the PPR has no ILE or VE. i have no idea what happened to create the records as they are.
    kind of fell into this...
  • jversusjjversusj Member Posts: 489
    update:
    i attempted to undo the receipt and received the following error message.
    Microsoft Dynamics NAV
    You cannot undo line 10000, because no Item Rcpt. Entry No. exists.
    OK

    so, i cannot undo the receipt, i cannot invoice the PO. Any ideas?
    kind of fell into this...
  • Alex_ChowAlex_Chow Member Posts: 5,063
    If a purchase receipt with items has no ILE, then that means someone has delete the item ledger entry using the developer's license.

    If that's the case, you're completely screwed... :(
  • ara3nara3n Member Posts: 9,255
    Did 3.7 actually have undo receipt?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,304
    ara3n wrote:
    Did 3.7 actually have undo receipt?
    My thoughts exactly :-k
  • Alex_ChowAlex_Chow Member Posts: 5,063
  • jversusjjversusj Member Posts: 489
    i want to doubt anyone deleted the entries, but in the interest of being thorough, i will check if anyone requested this from our partner. it just doesn't make sense that this course of action would be taken without anyone even consulting me, since my job here is the "NAV guy."

    very strange. thanks.
    kind of fell into this...
  • Alex_ChowAlex_Chow Member Posts: 5,063
    The easiest way to verify is to check the Entry No. on the ILE.
  • jversusjjversusj Member Posts: 489
    Alex Chow wrote:
    The easiest way to verify is to check the Entry No. on the ILE.

    gotcha... i'll look for a missing no. good idea! thanks.
    kind of fell into this...
  • jversusjjversusj Member Posts: 489
    okay, this is what i put together in a minute...
      bSkip := FALSE;
      IF (iPrevEntry + 1) = ILE."Entry No." THEN
         bSkip := TRUE;
    
      iPrevEntry := ILE."Entry No.";
      IF bSkip THEN
         CurrReport.SKIP;
    

    the report revealed no missing ILE entry no.

    so, it looks like something must have happened during the receipt post such that the ILE and VE were not created.
    kind of fell into this...
  • ara3nara3n Member Posts: 9,255
    Are there any other Ledger Entries created if you navigate on this Receipt?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jversusjjversusj Member Posts: 489
    ara3n wrote:
    Are there any other Ledger Entries created if you navigate on this Receipt?
    no sir...

    when i navigate on the receipt i see the following:
    Table Name No. of Records
    Posted Purchase Receipt 1

    that is it - no ILE. no VE. nothing like i would expect to see on a posted purchase receipt.
    kind of fell into this...
  • kapamaroukapamarou Member Posts: 1,152
    Could it be an Order which you once filled in, filled the Posting No. field and then deleted it? In that case I think you are prompted to create a blank Invoice.
  • jversusjjversusj Member Posts: 489
    kapamarou wrote:
    Could it be an Order which you once filled in, filled the Posting No. field and then deleted it? In that case I think you are prompted to create a blank Invoice.
    i'm sorry but i do not understand what you mean by this. i cannot delete the PO because it has a qty received not invoiced and i cannot invoice it because of missing ILE.

    @all,
    should i have my partner delete the posted receipt so that i can delete the PO (pretend like it never happend since there are no ledger entries anyhow)?
    kind of fell into this...
  • ara3nara3n Member Posts: 9,255
    they shouldn't delete the Receipt, but just put some comment deleted.

    Your partner will need to fix the po lines as though they are new lines and reset the fields.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jversusjjversusj Member Posts: 489
    ara3n wrote:
    they shouldn't delete the Receipt, but just put some comment deleted.

    Your partner will need to fix the po lines as though they are new lines and reset the fields.
    so we would want to blow out any fields on the PO line that suggest there has been posting (like forcing Qty received to 0, qty received not invoice to 0, etc.)?

    basically, create a new PO line and then make the original PO line look just like that one...
    kind of fell into this...
  • ara3nara3n Member Posts: 9,255
    yep.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I have seen this before, in 3.70 and in 4.00 sp2. I never tracked it in detail, but I only ever saw it in databass using Warehouse management AND eSHip.

    Can you check if on the order you have any lines with the same item number. This was a bug in Navision.

    What happened was that the routine that during invoicing that locates the order line that was shipped finds the first available line. But if you have two identical lines on the order and the second one was shipped before the first one then the sequence is messed up and you get exactly the error you are seeing, the reason being that the line it tries to invoice has actually already been invoiced.

    I have NEVER been able to reproduce this bug, but have seen it many times at different customers. Every customer had mods, so there is a bizarre chance that each client had the same mistake made, but I believe its due to an incompatibility with eShip and Warehouse.

    The fix is to delete the already shipped line and then invoice the other, but its not simple, and will take some playing with a developers license to do. We once had a big order with 100 lines or so, and had to manually post every line one by one till we got it all posted.

    I would not recommend deleting the line or adding new Item Ldger entires till you have first tried this.

    Also and VERY IMPORTANT, when posting if you have this error, the debugger will stop on the wrong line, I mean that the line that the error message pops up may not actually be the line with the error, so don't trust it.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    jversusj wrote:
    ara3n wrote:
    they shouldn't delete the Receipt, but just put some comment deleted.

    Your partner will need to fix the po lines as though they are new lines and reset the fields.
    so we would want to blow out any fields on the PO line that suggest there has been posting (like forcing Qty received to 0, qty received not invoice to 0, etc.)?


    basically, create a new PO line and then make the original PO line look just like that one...


    Please read my reply above, before trying this.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    It might also happen with get shipments.
    David Singleton
  • jversusjjversusj Member Posts: 489
    david - thanks.

    as luck would have it, we do have both warehouse management and eship. it could be part of the overall trend you've witnessed with this type of error.

    unfortunately (in regards to your suggestion), this PO only has a single line (line 10000). when i check the change log (where we are recording deletes from the purchase line table), i see no entries for this PO number, so i do not think anyone deleted any lines manually. also, the order line no. on the posted purchase receipt line is 10000, so it looks like we are trying to invoice the same line as we 'received.'
    kind of fell into this...
  • jversusjjversusj Member Posts: 489
    our partner looked at it. here is what they advised.

    reset the PO line to look new (pre-receipt).
    Receive / Invoice qty. (so that PO didn't just disappear).
    Adjust Qty out of system

    our license lets us use processing report to correct the PO line so i did this and received the line. when i attempted to invoice, i got the same error, because the system was still finding and attempting to process the old receipt line first.

    i was then advised that the purch. receipt and purch. receipt line needed to be deleted (since there were no entries posted this would "not hurt anything"). This was done. the PO was then able to be invoiced and finally closed. Inventory control then adjusted off the 4 pieces received/invoiced.

    so, not sure if it was the perfect solution, but it is done. thanks to all for your input!
    kind of fell into this...
  • kabirkabir Member Posts: 3
    Daer sir

    I am new here..

    I am trying to undo GRN Receipt. Item is having no inventory posting group.So, Item does not have any Item ledger entries.I want to undo this GRN..Please Suggest the solution.

    Microsoft Dynamics NAV

    Item ledger entries are missing for line 10000.
    OK
  • kabirkabir Member Posts: 3
    edited 2018-02-12
    Dear sir

    I am new here..

    I am trying to undo GRN Receipt. Item is having no inventory posting group.So, Item does not have any Item ledger entries.I want to undo this GRN..Please Suggest the solution.

    Microsoft Dynamics NAV

    Item ledger entries are missing for line 10000.
    OK
Sign In or Register to comment.