RE: How to Control User for posting
I have added a boolean field on User setup to allow or restrict the user from posting item journal, I have extended the item Journal page and added action.
My problem is if a user is not allowed to post item journal in user setup only the pop-up message appears (Which shows that you don't have permission) but after saying ok, the posting process continues I want to terminate the process completely if the user is not allowed to post
bellow is my piece of codes please assist
pageextension 50126 TestItmJ extends "Item Journal"
{
actions
{
modify(Post)
{
trigger OnBeforeAction()
var
UserSetup: Record "User Setup";
begin
if UserSetup.Get(UserId) then begin
if UserSetup."Post Item Journal" = false then
Message('You do not have permision to Post')
else
exit;
end;
end;
}
}
Thank you all