Delete or rename an empty vendor record

finderfinder Member Posts: 129
Hi,

I have one vendor record with blank code. It could have happened due to a mistake in the dataport but now I can't get rid of it. There are also vendor ledger entries with blank vendor card (related to vendor cards that have been deleted). Is it possible to delete or rename this blank vendor record manually or by code. I have tried to disable code in the OnRename function but it didn't help. At the moment I'm out of ideas. Can somebody help?

Thanks in advance,
Anti

Answers

  • kapamaroukapamarou Member Posts: 1,152
    I think you'll need to write code to do it... And a lot... For all the tables...

    If I remember correctly there was a Microsoft Update (of the client) that allows this... The vendor was actually renamed... Which client do you use and which build?
  • finderfinder Member Posts: 129
    I'm using NAV version 4.0 SP2. As I understood for deleting this blank record I have to change all Purchase Lines where Vendor Code is blank. But I'm happy if I could just rename it.
  • kapamaroukapamarou Member Posts: 1,152
    If I remember correctly, we couldn't rename it back to the normal code. We had to write code to do it, since it also involved several tables. But check your client build (have you applied any patches to the client?) because it could do the same for Customers, Accounts and so on... and it is very easy for the user to accidentally delete the code of a customer and confirm the renaming...
  • DaveTDaveT Member Posts: 1,039
    Hi Folks,

    The way I normally solve this is by creating a report, find the record and use

    vendor.delete( FALSE ); // i.e. don't run the on delete trigger

    N.B. This shoud only be done if you're sure that the vendor does not have dependant records - test it fully and do a database test afterwards.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • finderfinder Member Posts: 129
    Thanks DaveT, this delete(false) solved my problem. I hope it won't give me any problems in the future cause only places where I have records with blank vendor code are purchase lines where "No." field is blank (standard works this way) and some vendor ledger entries (which have blank vendor code as these vendors have been deleted).
  • DaveTDaveT Member Posts: 1,039
    Hi Finder,

    The No. being blank on purchase line is standard but if you have records on the vendor ledger entry with blank Vendor No. then this would concern me if the financial year is not closed where these apply.

    P.S. there's a new drop down for setting the post as solved
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • kapamaroukapamarou Member Posts: 1,152
    If you want to be sure try opening the demo company with your client and renaming a Vendor / Item / Customer etc... to blank (One with existing ledger entries). If this is not blocked by the system then you'll need to do something because it will occur again.
Sign In or Register to comment.