Problem while modifying Field Value of Posted Sales Invoice

logu_cbelogu_cbe Member Posts: 54
Hi,

One of our clinet wants to update some fields in Sales Invoice Header & Line table from External System.

It works in developer licence but not in clinet licence.

How we can setup permission for the same?

I will really appreciate any inputs to solve this.

Thanks,
Logu

Comments

  • SavatageSavatage Member Posts: 7,142
    Your client cannot edit the Sales Invoice Fields - Unless you define them as editable in codeunit 391
  • jversusjjversusj Member Posts: 489
    logu_cbe wrote:
    Hi,

    One of our clinet wants to update some fields in Sales Invoice Header & Line table from External System.

    It works in developer licence but not in clinet licence.

    How we can setup permission for the same?

    I will really appreciate any inputs to solve this.

    Thanks,
    Logu
    As an end user without a dev license, i'm pretty sure that's how it is supposed to work to keep companies from monkeying around with their books. that is, some tables cannot be modified, even by a super user because of the license, not the permissions.

    Please correct me if i am wrong, but modifiying tables like SIH requires the dev license.
    kind of fell into this...
  • logu_cbelogu_cbe Member Posts: 54
    Savatage wrote:
    Your client cannot edit the Sales Invoice Fields - Unless you define them as editable in codeunit 391

    Hi,

    Thanks for reply....

    Code Unit 391 modifies Sales Shipment Header.

    Any further clue in it?

    Thank You,
    Logu
  • SavatageSavatage Member Posts: 7,142
    Did you open the codeunit & take a look?

    You should see a function called
    SalesInvoiceHeaderEdit

    or you can addit

    SalesInvoiceHeaderEdit(SalesInvoiceHeader : Record "Sales Invoice Header")
    SalesInvoiceHeader2 := SalesInvoiceHeader;
    SalesInvoiceHeader2.LOCKTABLE;
    SalesInvoiceHeader2.FIND;
    SalesInvoiceHeader2."THE FIELD YOU WANT EDITABLE" :=
      SalesInvoiceHeader."THE FIELD YOU WANT EDITABLE";
    
    SalesInvoiceHeader2.MODIFY;
    SalesInvoiceHeader := SalesInvoiceHeader2;
    
  • davmac1davmac1 Member Posts: 1,283
    I believe you also need to add code to the form on modify trigger - this is what I have in mine:


    CODEUNIT.RUN(CODEUNIT::"Sales Invoice Header - Edit",Rec);
    EXIT(FALSE);

    The EXIT(FALSE) prevents the table trying to update itself from the form and getting an error.
Sign In or Register to comment.