EnterpriseManagementObject current instance

SCMSM 2012 custom control

I want to get the EMO of the current instance.

I tried :

 Guid guidObject = new Guid(instance["$Id$"].ToString());

   EnterpriseManagementObjectGenericCriteria genericCr = new EnterpriseManagementObjectGenericCriteria("Id = '" + StrID +"'");

 EnterpriseManagementObject emo = mg.EntityObjects.GetObject<EnterpriseManagementObject>(guidObject, ObjectQueryOptions.Default);

But I get the error that Oject with id .... is not found .

Is the object not created yet as an EMO ?

I do this at OnPreviewSubmit .

I want to Add the reviewers at creation time

October 31st, 2013 2:48pm

Why? Use the projection alias on your IDataItem. You can access the EnterpriseManagementObject using the $EMO$ property usually but still you should be using your IDataItem to work with relationships.

See my blog post here for some additional info:

http://scsmnz.net/c-code-snippets-for-service-manager-

November 8th, 2013 9:27am

Thanks for your help

Learned a lot from your snippets

February 10th, 2015 11:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics