no permission to modify records

kevin.7710kevin.7710 Member Posts: 40
how to solve "you have not permission to modify records in Purch. Inv. Header".
I wirte a new codeunit and create a funcation called PurchInvHeaderEdit
PurchInvheaderEdit(Rec : Record "Purch. Inv. Header")
Code below

PurchInvHeader := Rec;
PurchInvHeader.LOCKTABLE;
PurchInvHeader.FIND;
xRecRef.GETTABLE(PurchInvHeader);
PurchInvHeader."Bill of Lading No." := Rec."Bill of Lading No.";
PurchInvHeader.MODIFY;
Rec := PurchInvHeader;
RecRef.GETTABLE(PurchInvHeader);
ChangeLogMgt.LogModification(RecRef,xRecRef);

Then I change Posted Purchase Invocie form's OnModifyRecord trigger

CODEUNIT.RUN(CODEUNIT::"PurchInvHeaderEdit",Rec);
EXIT(True);

Please give me help.thanks!

Comments

  • BeliasBelias Member Posts: 2,998
    codeunit>properties>permissions...add necessary permissions...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_CoxDavid_Cox Member Posts: 509
    Did you set the permissions on your codeunit to allow edit of the table?
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • kevin.7710kevin.7710 Member Posts: 40
    I already added the permission. but the error till exist.
  • BeliasBelias Member Posts: 2,998
    verify that the table you're modifying has indirect permissions to write in it...
    edit: ...4 the roles that need it
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kevin.7710kevin.7710 Member Posts: 40
    Hi,Belias.Can you describe in more detail? Thanks
  • BeliasBelias Member Posts: 2,998
    verify what role are you using, then click tools>security>roles
    select your role, click role>permissions, find the table you're trying to modify and give it at least an indirect permission on write column..
    btw, what value does your permission property has?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kevin.7710kevin.7710 Member Posts: 40
    my role settings are: All, Super (Data), Super
  • BeliasBelias Member Posts: 2,998
    i think you're a developer...in that case you should toggle the "all" role from your user (and ONLY from your user)...then syncronize if you're on sql..(it can takes a long of time if there are a lot of users)

    EDIT: i didn't read carefully...you need ONLY the "super" role, so you should also toggle the super(data) role from your user's roles
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kevin.7710kevin.7710 Member Posts: 40
    Belias, Thanks. I move this code to OnRun Tirgger. Now it will modify the table.
  • BeliasBelias Member Posts: 2,998
    :?
    I move this code to OnRun Tirgger
    why?i mean...did this solve your problem?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • krikikriki Member, Moderator Posts: 9,110
    Can you change your topic-title to a title that is descriptive.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • krikikriki Member, Moderator Posts: 9,110
    Changed title from [Please help,urgent!!] to [no permission to modify records]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.