Hello experts,
Hope you're all doing well.
I've a function "MyFunction(UserId: Code[50])" in a codeunit which further calls a system's function. In that system's function, code runs according to the current user that is currently logged in the business central. In 'MyFunction', I want to run that system's code according to the user I'm passing as a parameter.
In Finance and Operations, there is a method 'RunAs' which runs the code according to the user provided in the method 'RunAs'. Is there any way to perform this functionality in Business central? Answers will be highly appreciated. Thanks for reading.