自定义OOB WebPart以更新当前会话中的自定义字段而无需签入或签出项目 [英] Custom OOB WebPart to Update Custom Fields in current session without checkin or checkout the project

查看:116
本文介绍了自定义OOB WebPart以更新当前会话中的自定义字段而无需签入或签出项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望标题本身说明我的需要。

I hope the title itself says my need.

我需要创建一个webpart,它应该像现有的OOB webparts一样,这将在PDP页面中使用,并在用户单击PDP页面中的"保存"按钮时更新ECF /项目字段。所以我无法检查项目,不应该检查它,
必须更新当前会话中的所有内容,你得到它 

I need to create a webpart which should act like existing OOB webparts, this will be used in PDP page and updates the ECF / Project Fields when user click on Save button which is in PDP page. So I can't checkout the project and shouldn't checkin it back, have to update everything in the current session itself, you got it 

谢谢。

谢谢,Saravanan PRS

Thanks, Saravanan PRS

推荐答案

这实际上可以做到! (原谅我自己的惊喜,因为我最近有类似的要求)

That is actually possible to do! (Excuse my own surprise as I recently had a similar requirement)

这是假设一些事情;首先,我们正在讨论基于PSI的webpart,其次是项目已经检出(即你想"借"另一个结账会话)。 

That is assuming a few things; firstly that we are talking about a PSI based webpart, and secondly that the project is already checked out (ie you want to 'borrow' another checkout session). 

基本上你需要什么要做的是询问ProjectDataSet并获取当前签出的会话"PROJ_SESSION_UID",然后在QueueUpdateProject中使用该会话UID进行模拟。

Basically what you need to do is interrogate the ProjectDataSet and get the current checked out session "PROJ_SESSION_UID", then use that session UID in your QueueUpdateProject WITH impersonation.

这是一个代码片段 - 来自我的助手方法:

Here's a code snip-it from my helper method for this:

if (!projectDataset.Project[0].IsPROJ_CHECKOUTBYNull())
{
	_checkedOutUser = projectDataset.Project[0].PROJ_CHECKOUTBY;
	_sessionDesc = projectDataset.Project[0].PROJ_SESSION_DESCRIPTION;
}

// Return the existing session uid and user uid if the project is checked out
return projectDataset.Project[0].PROJ_SESSION_UID;

对于2013年情况有所不同,但实际上如果您使用的是SharePoint任务列表项目,这一切都非常简单(无需检查)开箱即用的网页部件需要/签出。

For 2013 things are different but actually if you're using SharePoint Task List projects this is all super easy (no checkin / check-out required with the out of the box web parts).


这篇关于自定义OOB WebPart以更新当前会话中的自定义字段而无需签入或签出项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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