Project Server 2013.无法使用CSOM以编程方式更新项目所有者 [英] Project Server 2013. Unable to update Project Owner programmatically using CSOM

查看:83
本文介绍了Project Server 2013.无法使用CSOM以编程方式更新项目所有者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用CSOM更新项目所有者。


以下是我正在使用的代码。


我可以看到它在调试代码时作为SharePoint用户添加。 draftProject.Owner = e.User;


但是在更新和发布之后,没有任何变化。


public static void assignToTeam(ProjectContext projContext,DraftProject draftProject,Guid projectGuid,EnterpriseResource e)

        {

            projContext.Load(draftProject.ProjectResources);

            projContext.Load(e);

            projContext.Load(e.User);

            projContext.Load(draftProject);

            projContext.ExecuteQuery();
$


            draftProject.ProjectResources.AddEnterpriseResource(e);

            var updateResoColl = draftProject.Update();

            projContext.WaitForQueue(updateResoColl,Constants.timeoutSeconds);



            DraftProjectResourceCollection newResoColl = draftProject.ProjectResources;



            projContext.Load(e.User);

            projContext.ExecuteQuery();

            draftProject.Owner = e.User;

            draftProject.Update();

        }




Brandon James SharePoint开发人员/管理员

解决方案

嗨詹姆斯,


你读过这篇类似的帖子吗?这可能对你有帮助。


http://social.msdn.microsoft.com/Forums/en-US/8b0e08b5-cd90-4fb1-b413-7a3e5a07e643/setting-the-project-所有者时-最初创造-A-项目与 - CSOM?论坛= project2010custprog


I'm unable to update the Project Owner using the CSOM.

Below is the code I'm using.

I can see it being added as a SharePoint user when I debug the code. draftProject.Owner = e.User;

But after the update and a publish, nothing changes.

public static void assignToTeam(ProjectContext projContext, DraftProject draftProject, Guid projectGuid, EnterpriseResource e)
        {
            projContext.Load(draftProject.ProjectResources);
            projContext.Load(e);
            projContext.Load(e.User);
            projContext.Load(draftProject);
            projContext.ExecuteQuery();

            draftProject.ProjectResources.AddEnterpriseResource(e);
            var updateResoColl = draftProject.Update();
            projContext.WaitForQueue(updateResoColl, Constants.timeoutSeconds);

            DraftProjectResourceCollection newResoColl = draftProject.ProjectResources;

            projContext.Load(e.User);
            projContext.ExecuteQuery();
            draftProject.Owner = e.User;
            draftProject.Update();
        }


Brandon James SharePoint Developer/Administrator

解决方案

Hi James,

Have you read this similar post? This might help you.

http://social.msdn.microsoft.com/Forums/en-US/8b0e08b5-cd90-4fb1-b413-7a3e5a07e643/setting-the-project-owner-when-initially-creating-a-project-with-csom?forum=project2010custprog


这篇关于Project Server 2013.无法使用CSOM以编程方式更新项目所有者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆