Hi,
Does someone know how I can get the current user id with jscript in Smart Office?
I think this might be what you are aftervar userID = UserContext.User
I have tried that, but it does not work for me.
I get this error:
Type 'Mango.Services.UserContext' does not have such a static member
To be sure we are comparing apples with apples we are running 13.2 OnPrem, so if you are running a later version the following might not be of any use.Before my previous message I checked with this test script
import MForms; package MForms.JScript { class TEST { public function Init(element: Object, args: Object, controller : Object, debug : Object) { var userID = UserContext.User; debug.WriteLine(userID); } } }
If you run this in your Script Tool do you get the same error message?
I find that I get this error message "error JS1246: Type 'MForms.UserContext' does not have such a static member" if I use UserContext.user rather than UserContext.User
I'm running 13.4 on prem.
I tried both small and capital letter but get the same error in the script tool (error JS1246: Type 'Mango.Services.UserContext').
But I tihink you helped me found the, I removed one import ( import Mango.Services) and now I do not get the error message änymore.
Thank you!!