Error in Suggest Vendor Payments. Anyone else getting this?

Tommy_SchouTommy_Schou Member Posts: 117
edited 2014-07-01 in NAV Three Tier
Hi

We had a dealer report and error in our "Suggest Vendor Payments" report. He basically got the error message;

"Payable Vendor Ledger Entry already exists. Identification fields blah blah".

At first I was sure we had made a grave mistake somewhere but then I managed to produce the exact same error in a Standard NAV 2009 SP1.

What you do is the following:

go to Vendor 20000 and Block him for payment.

Start a Payment Journal and activate: "Suggest Vendor Payments". Now assuming that you have due vendor ledger entries on Vendor 20000 and that they are within the filter of your report you will get an error:

"You cannot create this type of document blah blah".

Now press OK and run "Suggest Vendor payments" again. Now you get the error;

"Payable Vendor Ledger Entry already exists. Identification fields blah blah".

Why?

As far as I can see the RTC does NOT clear the contents of temporary tables correctly. If you put ""Payable Vendor Ledger Entry.DELETEALL" in the "Vendor - OnPreDataItem" trigger everything starts working again.

Just a FYI and if you could confirm that the same error exists in your environment I would appreciate it. If this is a known issue and I am just being stupid about something I would very much appreciate a heads up on that as well. :)
Best regards
Tommy

Comments

  • craig.scraig.s Member Posts: 4
    This is not your imagination. One of our clients is experiencing the same issue and I'm about to investigate.

    Cheers
    Craig
  • craig.scraig.s Member Posts: 4
    Well, this has been a frustrating exercise. I haven't been able to prove anything beyond all reasonable doubt. It is one of those experiences where the report seems to do one thing one time and something different the next. Or you'll do something like add a message to assist with debugging which then makes the report work properly. Crazy. ](*,)

    What I suspect is happening (as you have suggested above) is that the PayableVendLedgEntry (a temp table) is not being cleared. Even when the report is closed and re-run.

    In Vendor OnAfterGetRecord you will find PayableVendLedgEntry.DELETEALL;

    If this does not run (i.e. there is an error prior to OnAfterGetRecord being run), you'd expect the table to be destroyed after the report goes out of scope. i.e. it should have the same effect as having run PayableVendLedgEntry.DELETEALL;

    But it does not.

    For the time being I am just adding PayableVendLedgEntry.DELETEALL; in the OnPreReport trigger and I'll refer onto Microsoft.

    Cheers
    Craig
  • Ben_DysonBen_Dyson Member Posts: 18
    Hi All

    I'm having trouble with this myself now and on a customers machine.

    Having a look at the table in this instance I can see that there is already no data in it. Went into SQL and did:

    select * from MYDATABASE.dbo.[CRONUS UK Ltd_$Payable Vendor Ledger Entry]

    This is showing the table as empty before the system is even looking at this. I did try to add the line

    PayableVendLedgEntry.DELETEALL;

    to the report 393 at the top make sure the table is cleared out and it didn't help.

    Still getting this error message and unable to suggest vendor payments. Any ideas on this.
  • Ben_DysonBen_Dyson Member Posts: 18
    Hi All again

    I've been looking at this and have finally with a colleague of mine discovered the issue. The table PayableVendLedgEntry is getting locked by the NAV service, if you turn the NAV service off and back on again and clear out the current list of sugested payments the suggest button will work again. So on looking for a better way than having the customer get all his users to leave NAV and restarting the service every time this happens, we found a line of code very similar to Craig.S's

    PayableVendLedgEntry.RESET;

    We put it in the same place at the begining of the 393 report and although you have to leave Payment Journals and go back in again, it does allow you to re-run the report without the error message. You do still need to delete all lines in the payment Batch before re-running.

    I can't help think that there is a better way of dealing with this locked table in the code, we are not programmers but implementor and support, so if any C/AL pros out there can see a better way please update this thread :-)
  • Vickster69Vickster69 Member Posts: 16
    We've been experiencing this error intermittently as well with one of our RTC customers. It's absolutely infuriating as we can't replicate it on Cronus in order to log a support incident with Microsoft! However their system isn't modified in any of the relevant areas, so it seems strange that Cronus won't throw up the same error.

    We've tried everything suggested in this thread but none of it has worked for us so far. Hopefully someone might have another suggestion soon though...

    :)
  • paulburnett224paulburnett224 Member Posts: 1
    We came across this as well in NAV 2009 R2. The error is gave in RTC said "Payable Ledger Entry Already Exists......." but that is not the real error. In classic we did the payment journal and received a different error message that gave an entry number. we went to that entry number and realized that the payment journal was not fully applied. but was posted. We cleared the applies to cell on the lines and everything worked after that. See example below

    Vendor "XYZ" suggested vendor payment of $100,000 ($50,000 and $50,0000).
    Payment journal line was left at $100,000.00
    Applied entries where done only to $80,000.00 (50,000 on one line and 30,000 on the other line), Balance = $20,000
    Then they posted it. The unapplied entries stayed in limbo and prevent the payment journal from running again until those entries where cleared.
Sign In or Register to comment.