Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
In ThingworxStorage logs the logger user is different than the user returne by Resources["CurrentSessionInfo"].GetCurrentUser();
The service I have try to set a property to the user:
logger.debug(l"Input->PlantUPL-> " + PlantUPL);
var user = (UserName!=null) ? UserName : Resources["CurrentSessionInfo"].GetCurrentUser();
logger.debug(l "User-> " + user);
Users[UserName].LastPlantUPL = PlantUPL;
The Script Log shows this error:
Somehow user U529679 is in the logs but u106949 is the current user in the Resource.
Hello.
This article might be relevant. It looks like the returned string value needs to be typecast to a User type.
Try something like:
var currentUser = Resources["CurrentSessionInfo"].GetCurrentUser();
var result = Users[currentUser].property1;
Thanks,
-- Craig A.
Hi @vguevaraperez.
If the response provided by @CRArko answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon