Print Sales Orders w/o Sales Header Table Modify Rights

btaplinbtaplin Member Posts: 4
I would like to disallow any modification of existing Sales Orders by members of certain roles, however; I would like to allow Sales Order printing by those same members.

I have set the Sales Header table permissions to 'Read Only' for the role(s) pertaining to these members.

I would assume the reason the 'You do not have permission to modify records in the Sales Header table.' warning is displayed when trying to print a Sales Order is because Navision is trying to update the 'No. Printed' field.

Does anyone know of a 'quick and easy' way to get around this?

Thank you.

Comments

  • cnicolacnicola Member Posts: 181
    You can add write permissions to the report. And then if I am not mistaken you add in the permission group modify as Indirect and you are set.
    The result is that your users will still need read permission to run the report but will not have modify permissions to Sales Header (unless when running an object with the permissions defined inside)
    Apathy is on the rise but nobody seems to care.
  • btaplinbtaplin Member Posts: 4
    To go a step further, I am trying to print the Sales Order using the 'Print...' button found at the bottom of the Sales Order form.

    I have found that the error is raised by the following block of code found in Codeunit 60 Sales-Calc. Discount\CalculateInvoiceDiscount(SalesHeader,SalesLine2)

    IF NOT TemporaryHeader THEN BEGIN
    IF NOT RECORDLEVELLOCKING THEN
    SalesLine2.LOCKTABLE(TRUE,TRUE);
    SalesHeader.MODIFY; <<<<<<< Breaks Here
    END;

    So what I have done is give the role 'Read Permission' as well as 'Indirect Modify Permission' to the Sales Header table. I have also granted the role 'Full Permission' to Codeunit 60.

    Isn't this the point of the Indirect Permission or am I missing something?

    Shouldn't the role have access to modify the Sales Header table indirectly via Codeunit 60?

    Thanks again.
  • krikikriki Member, Moderator Posts: 9,118
    All objects should only have execute permission. This serves to be able to run the code inside to be run. So if you don't want some role to run it, don't even give that. The read,insert,modify,delete-permission of these are only for design.
    "Table Data": this is the one that doesn't need execute permission. But here serves read,insert,modify,delete because it is the DATA OF THE TABLE, and not the table-object itself.
    So you have to give only execute-permission to a role for C60. And indirect modify (and maybe also read if those users may not even see table 36.37) to T36+T37 + maybe some dependant tables.
    In C60 you put permissions for T36,T37,... to read and modify. These are indirect permissions.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • btaplinbtaplin Member Posts: 4
    Sorry, I should perhaps clarify.

    I had given read and indirect modify permissions to Table Data 36 as well as Table Data 37, Execute Permissions are also granted.

    I have changed C60 to Execute Permissions only.

    Still no success.

    Is there some additional code that needs to be inserted into C60 (other than the code listed previously) to open up access to modify the data in Table 37 indirectly?

    I must be missing something very simple.
    This is extremely frustrating.

    Thanks again.
Sign In or Register to comment.