[EventSubscriber(ObjectType::Codeunit, Codeunit::"System Initialization", 'OnAfterLogIn', '', false, false)] local procedure UpdateLastLoginInfo() var LoginHistory: Record csa_User_Login_History; lastLoginDuration: Duration; begin if UserId <> 'SYSTEM' then if LoginHistory.Get(UserId) then begin lastLoginDuration := CurrentDateTime - LoginHistory."Last Login DateTime"; if (lastLoginDuration > (5 * 60 * 1000)) then begin LoginHistory."Last Login DateTime" := CurrentDateTime; LoginHistory.Modify(false); <------ [b]this line right here errors out[/b] end; end else begin LoginHistory.Init(); LoginHistory."User ID" := UserId; LoginHistory."Last Login DateTime" := CurrentDateTime; LoginHistory.Insert(); end; end;
Error Code:18023831
Sorry, the current permissions prevented the action. (TableData csa_User_Login_History User Login History Modify: Chase Base Application)
Answers
Seems like existing functionality.
If it is very important to you that it registers for all companies, just write code that automatically turns this on when a new user setup record is created, and activate it on all others
Also, looking at what you linked, not sure it'd fit what they want.