I don`t want to use third party, I tried to do the following
trigger OnOpenPage()
var
myInt: Integer;
UserSetup: Record "User Setup";
begin
if UserSetup.Get(UserId) then
if UserSetup."Batch security" = false then begin
if rec."Created by" <> UserId then begin
Message('You do not have permissions to edit this page');
Editable(false);
end
else
Editable(true);
end;
end;
I created "Created by" field on gen. journal Lines and used the above code
Batch security is a boolean field in user setup