Tuesday, June 26, 2012 7:02 PM
I have a form in Service Manager. I perform somw operations using the SDK. I would like to know how to get the current open object and the current user object so that I can use then when creating relationships.
Wednesday, June 27, 2012 7:35 PMModerator
Check my reply to your question for accessing the current item from an open form here:
You can use "emg.GetUserName()" to get the current username and then search for it like any other EnterpriseManagementObject.
To set a relationship using your emoUser and the current instance you can do this:
EnterpriseManagementObjectDataType dataType = new EnterpriseManagementObjectDataType(mpcADUser); IDataItem iUser = dataType.CreateProxyInstance(emoAssignToUser); i[sAssignedTo] = iUser;"sAssignedTo" is the alias of the type projection relationship that you want to set.
Rob Ford scsmnz.net