csom - DraftProjectResource->IsGenericResource returning wrong value -
I am using CSOM to cross a project through Project Server 2013 resources. I am checking that the resources are normal because I wrote code logic based on it. I have a BA and PM generic resource which is part of a project I added to the project server using the Build Team feature. These resources are shown with the normal Zedic flag while viewing them in the Resource Center. But returning IsGenericResource
as the program code False
.
Here the code snippet (relevant code ** is in):
Public string process generic resource (ProjectConttex PC, published published project project) {try {Boolean BSFringRoustEight update = False; // It will be set to correct when a staffing list item updates the string sResourceApproverAttr = ExceptionUtility.ReadKeyFromConfig (sResourceApproverKey); String sRet = ""; Draft project project; If (published project.isacquetteat) project = published project. Draft This includes the custom field; Other Project = Publish Project. check out (). Include CustomFields; Pc.Load (project, p = & gt; p. Name, p = & gt; pid); Draft ProjectRSOSROOCROOCRACOCORP = Project. Pc.Load (ProjectResources, list = & gt; list.Include (item = & gt; item.Name, item = & gt; item.Id, item = & gt; item.IsGenericResource)); Pc.ExecuteQuery (); // For every general resource, check that an item is already in the staffing request list. If a foreach (DraftProjectResource resource in ProjectResources) does not create {list & lt; String & gt; ListRMsNotified = New list & lt; String & gt; (); // This is to keep track of already notified PMLOd (resource) RM; Pc.ExecuteQuery (); ** bool bGenericResource = resource.IsGenericResource; ExceptionUtility.LogMessage ("Resource = & gt; Name:" + Resources. Name + "id:" + resource.Id + "What is the common resource?:" + BGenericResource); **
I got the problem, apparently the project resource is not the same as EnterpriseResource. Project contexts for processing in project projects. You will need to find a match in the Enterprise Resource collection. The record in the Enterprise Resource Collection shows the correct value in the IsGeneric attribute.
Comments
Post a Comment