Hi there everyone!
I need to update a field on the item table and I'm using the code below on the OnRun() Trigger of a button placed in the item list form.
Window.OPEN(Text001 + '@1@@@@@@@@@@@@\');
Window.UPDATE(1,0);
TotalRecNo := Rec.COUNT;
RecNo:=0;
itemTable.RESET;
itemTable.FIND('-');
itemTable.MODIFYALL("Qtd Calculo Necessidades", 0);
Rec.FIND('-');
REPEAT
Rec.CALCFIELDS(Inventory2);
Rec.VALIDATE("Qtd Calculo Necessidades", Inventory2);
Rec.MODIFY;
RecNo+=1;
Window.UPDATE(1, ROUND(RecNo/TotalRecNo*10000,1));
UNTIL Rec.NEXT = 0;
FORM.RUN(50069);
My problem is that the code above only works if the user as the db_owner permision. Otherwise it doesn't update the required field.
I've given the premision to RMID for the Item Table, sinchronized the user and it doesn't work...
Is there any problem with my code? How can I solve this issue?
Thans in advance
Comments
RIS Plus, LLC
But the role is updated and the user is synchronized...
I've given the SUPER role to the user, after that synchonized him and it still doesn't work...
It only works properly after I give him the db_owner permission. I know it is strange... I hope that someone in mibuso can give me a possible solution for this...
Thanks
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The problem is that I dont get an error message.
The Field that I want to modify doesn't get updated... after the routine it stays just as it was before.
If I give the db_owner permission the field is updated.
I changed your code to do this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thank you for your reply.
I've made those changes but unfortunately my problem continues...
It doesn't update the required Item table field...
But, by the way, thank you for those programing guidelines!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!