Cannotg delete a 'Main Asset'

bhalpinbhalpin Member Posts: 309
Hi.

Dataporting in a bunch os Fixed Assets, I've ended up with some that are 'lint' and need to be deleted. On the Fixed Asset card, any attempt to delete the asset results in the error "A main asset cannot be deleted."

(As usual, the error is accompanied by the usual helpfull explanation of why you can't delete it and suggests other solutions . . . NOT!) (Sorry, just had to vent.)

The debugger lands you in the OnDelete trigger, and there it's pretty plain that there's no way they're gonna let you delete it - but no reason why. (Why put comments in that might explain things? The code is obvious!) (More ranting . . . sorry.)

This 'Main Asset' has no components, no depreciation book, no ledger entries, nothing other than a record in the asset table 5600 - so I can 'nuke it from orbit'. But I'm alway' reluctant to go ripping wires out, if you know what I mean.

Does anyone have any idea why they don't want you deleting a main asset?

Bob

Oh - On the asset card, trying to change the "Main Asset/Component" field from "Main Asset" to "Component" doesn't work - it just switches back. (There's more 'magic' happening I guess.)

Comments

  • idiotidiot Member Posts: 651
    First of all welcome to the world of Navision
    You're experiencing what I've been experiencing - hopelessness; but you'll learn how to live with it in due course...by not expecting too much.

    1. Navision is an "ancient" product, so many things are addons to ancient codes, & some codes are going to work forever that way coz nobody likes to fix others' codes.
    2. There are lazy developers around, so there's no optimization to enhance the ancient codes. If they don't know how to handle it, just give a generic error by reusing ancient codes or just put an error to stop you from doing it instead of pinpointing the exact place where the error occurred.

    Then to help you, "Main Asset/Component" field is not for changing anything but for display purposes. Go to the main asset card -> Fixed Assets button -> Main Asset Component to delete whatever components defined in here. Thereafter you can delete the Main Asset.

    Oh if you're not of the lazy programmers category, you might consider putting some enhancements into the delete functions of main assets so they auto unlink or delete the components...
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • bhalpinbhalpin Member Posts: 309
    Great reply! Thank's.

    Here's the best analogy I've found to NAV code:

    http://www.prewarbuick.com/features/jed_clampetts_buick

    (The truck, not the TV show.)

    O:)
Sign In or Register to comment.