Trying to modify record on Sales invoice Header Business Central

AordonezAordonez Member Posts: 8
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 Member Posts: 39
    Did you tried explicit the table permissions on your codeunit? This may solve your issue
  • AordonezAordonez Member Posts: 8
    How can i achieve this? i already validate by code the write permissions and the procedure returns me false
  • RobyRRobyR Member Posts: 39
    > @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 Member Posts: 8
    SaaS do you have an example for this?
  • AordonezAordonez Member Posts: 8
    Thanks so much!!!
  • RobyRRobyR Member Posts: 39
    Your welcome 👍
  • AordonezAordonez Member Posts: 8
    Roby one last doubt i need to update different table on the same codeunit how can i grant permissions for all the tables?
  • TallyHoTallyHo Member Posts: 417
    Try

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

    If this is not working, it is probable not possible.
  • RobyRRobyR Member Posts: 39
    > @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.