DELETEALL and Permissions in report

gadzilla1gadzilla1 Member Posts: 316
Hello all,

I created a table that I run 'DELETEALL' to in the OnPreReport section of a report to delete the table records. The user who will be running the report gets the 'cannot delete' error since they have the 'SUPER (W/O DBDEL)' role and cannot delete table data.

What is the best way to get around this? (I tried the report Permissions but that did not seem to fix the error) Thanks for any help.

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi

    Why delete all the records?

    Would a temporary table be of use?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • kinekine Member Posts: 12,562
    Question is, on which table you need to delete. If your permissions in your license say "indirect" permissions, you cannot delete the records from there without assigning special rights to the report and this can be done only with license, which have full rights to the table (e.g. partners designer license).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    is this your own table or a standard table?
    Do you make it right, it works too!
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks for all of the replies.

    The table I am using I created, so it is not a standard table. I used the table to resort the data before an export to excel. I created the table to include a variable calculated in the report in the primary key for sorting purposes.

    I was having issues trying to figure out the xlrange to sort and wanted to just use the excel buffer alone.

    I'm open to using a temporary table if it provides the same result.
  • DaveTDaveT Member Posts: 1,039
    Hi,

    Sound like the perfect example for a temporary table. Just set the property on the record variable and you should be sorted.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • garakgarak Member Posts: 3,263
    gadzilla1 wrote:
    I used the table to resort the data before an export to excel.

    and before you delete all datas. What is, if a other user runs this programm while user A runs it ;-) User B delete the datas of user A.
    So, use this table as temporary table (property temporary in the variabledeclaration)
    Do you make it right, it works too!
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks again for the replies.

    garak: I took your advice (property temporary in the variable declaration) and everything worked like a charm. In regards to the concern of user B deleting user A, this will be run 1x per day by one user.

    Very cool! :D
Sign In or Register to comment.