Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Unable to Update Project Level Custom Field using CSOM

$
0
0

Hi,

I have started using CSOM for my Project Online and I could successfully Read and Create Project. But was wondering how to update project level customfields. Following is my code for the same. Please let me know where I am making mistake.

 var PrjList = projContext.LoadQuery(projContext.Projects.Where(proj => proj.Name == "HelloWorld"));
                projContext.ExecuteQuery();
                Guid pGuid = PrjList.First().Id;

                Project p = projContext.Projects.GetByGuid(pGuid);

                var cfList = projContext.LoadQuery(p.CustomFields.Where(cf => cf.Name == "MyTest"));
                projContext.ExecuteQuery();

                CustomField c = projContext.CustomFields.GetByGuid(cfList.First().Id);

                p.SetCustomFieldValue("MyTest", "HIIIIIIIII");
                p.CustomFields.Update();


Thanks, Parth


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>