Nav 2013 R2 restrict delete on all posted documents.

zulqzulq Member Posts: 204
edited 2014-04-25 in NAV Three Tier
How can I stop all users from deleting posted documents including super users?
Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Set the property DeleteAllowed to 'No' for all posted document Pages.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • zulqzulq Member Posts: 204
    Sorry for not mentioning but have already done it at that level.
    Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
  • JuhlJuhl Member Posts: 724
    Put Logic on the Table instead.

    Put an ERROR() in the OnDelete trigger og the tables.
    Follow me on my blog juhl.blog
  • geordiegeordie Member Posts: 655
    Juhl wrote:
    Put Logic on the Table instead.

    Put an ERROR() in the OnDelete trigger og the tables.

    This is the same thing done by MS on some posted documents tables on IT localization :wink:
  • zulqzulq Member Posts: 204
    What I have done is put an error on all header tables if
    posting date <> 0D
    
    . Is this the best way to do it?
    Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
  • Wisa123Wisa123 Member Posts: 308
    Quite redundant, because a posted Document should have a posting date anyway.

    just put an Error('not allowed') or whatever you like on the beginning of the OnDelete Trigger of the table.
    Austrian NAV/BC Dev
  • zulqzulq Member Posts: 204
    @Wisa123, where is the data stored before it's posted?
    Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
  • Wisa123Wisa123 Member Posts: 308
    Unposted sales documents (quotes, invoices) are stored in table 37 - Sales Line (correct me if im wrong on the ID)

    When the Invoice/Shipment is posted the concerning SalesLine's get deleted and SalesInvoiceLine's/SalesShipmentLine's are generated by the posting routines.
    So if you dont want Posted Documents to be deleted you want to insert the Error in the onDelete of:
    * Sales Invoice Line
    * Sales Shipment Line

    at least on the sales side of things.
    Austrian NAV/BC Dev
  • JuhlJuhl Member Posts: 724
    Put ERROR() on OnDelete trigger of tables:
    110, 112 and 114 for sales
    120, 122 and 124 for purchase
    Follow me on my blog juhl.blog
  • zulqzulq Member Posts: 204
    Thanks @Juhl, this is exactly the tables where I have place the code just wasn't so sure.
    Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
Sign In or Register to comment.