Trying to modify record on Sales invoice Header Business Central

AordonezAordonez Posts: 8Member
edited 2019-04-13 in NAV Three Tier
Hello i am trying to Update come fields on one record for table "Sales Invoice Header" by code, but when it reach my modify(false); i got the error "You do not have the following permissions on TableData Sales Invoice Header: Modify. To view details about your permissions, see the Effective Permissions page. To report a problem, refer to the following server session ID: '91'."

Is there a way to achieve this?

Put my code for more references

salesInvcHdr.Reset();
salesInvcHdr.get(idDoc);
if success then begin
salesInvcHdr."Fiscal Invoice Number PAC" := uuid;
salesInvcHdr."Date/Time Stamped" := Format(Today);
salesInvcHdr."Date/Time Sent" := Format(Today);
salesInvcHdr."Error Code" := '';
salesInvcHdr."Error Description" := '';
salesInvcHdr."Electronic Document Status" := stampStatus::"Stamp Received";
end
else begin
salesInvcHdr."Fiscal Invoice Number PAC" := '';
salesInvcHdr."Date/Time Stamped" := '';
salesInvcHdr."Date/Time Sent" := '';
salesInvcHdr."Error Code" := '99';
salesInvcHdr."Error Description" := errMsg;
salesInvcHdr."Electronic Document Status" := stampStatus::"Stamp Request Error";
end;
salesInvcHdr.Modify(false);

Thanks in advance

Best Answer

Answers

  • RobyRRobyR ItalyPosts: 39Member
    Did you tried explicit the table permissions on your codeunit? This may solve your issue
  • AordonezAordonez Posts: 8Member
    How can i achieve this? i already validate by code the write permissions and the procedure returns me false
  • RobyRRobyR ItalyPosts: 39Member
    > @Aordonez said:
    > How can i achieve this? i already validate by code the write permissions and the procedure returns me false

    Did you explicitly write Modify permissions for the sales invoice header on your codeunit, and nothing changed? Are you in Business Central on Prem or SaaS?
  • AordonezAordonez Posts: 8Member
    SaaS do you have an example for this?
  • AordonezAordonez Posts: 8Member
    Thanks so much!!!
  • RobyRRobyR ItalyPosts: 39Member
    Your welcome 👍
  • AordonezAordonez Posts: 8Member
    Roby one last doubt i need to update different table on the same codeunit how can i grant permissions for all the tables?
  • TallyHoTallyHo Posts: 268Member
    Try

    Permissions = 0 = RIMD;
    or
    Permissions = "0" = RIMD;

    If this is not working, it is probable not possible.
  • RobyRRobyR ItalyPosts: 39Member
    > @Aordonez said:
    > Roby one last doubt i need to update different table on the same codeunit how can i grant permissions for all the tables?

    I don't know if TallyHo solutions works, on c\al was necessary to specify each permission, try with TallyHo solution or specify permissions for each table separated by comma
Sign In or Register to comment.