无法使用PSI更新项目自定义字段。

编程入门 行业动态 更新时间:2024-10-21 18:32:38
本文介绍了无法使用PSI更新项目自定义字段。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好,

Hi All ,

我正在编写使用psi更新企业项目自定义字段的代码,该值在任务级别得到更新(我的意思是我在项目专业中添加一个任务,我能够看到这个字段自动更新给定值),当我在项目中心视图中添加projectcustom字段时,它显示为null。我该怎么做才能显示那里的值。

I am writing the code to update the enterprise project custom field using psi , the value is getting updated in the task level(I mean when i add a task in project professional i am able to see this field getting automatically updated with the given value) , when i add the projectcustom field in project center view, Its showing null. What should i do to display the values there.

下面是代码 -

是否需要进行任何修改代码。请帮忙。

Should any modifications need to be done in the code.Please help.

Indresh

推荐答案

Indresh,

Indresh,

您提供的代码将仅用于更新项目中已存在的自定义字段。如果需要添加自定义字段,则需要更改。

The code you have provided will ONLY work for updating a custom field that already exists on the project. If the custom field needs to be added, things need to change.

1。您需要实例化一个新的ProjectDataSet(您不能使用您用于读取项目的那个,它必须是一个新的ProjectDataSet())。

1. You need to instantiate a new ProjectDataSet (you cannot use the one that you used to read the project, it has to be a new ProjectDataSet()).

2。您将新的自定义字段添加到此新ProjectDataSet,但您只需设置CUSTOM_FIELD_UID,PROJ_UID,MD_PROP_UID和NUM_VALUE,不要混淆任何其他字段。

2. You will add the new custom field to this new ProjectDataSet, but you only have to set CUSTOM_FIELD_UID, PROJ_UID, MD_PROP_UID and NUM_VALUE, don't mess with any other fields.

3。您将需要调用project.QueueAddToProject()并传入我在上面的步骤1和2中描述的新ProjectDataSet。

3. You will need to call project.QueueAddToProject() and pass in the new ProjectDataSet that I described in step 1 and 2 above.

底线是您不能使用现有的ProjectDataSet来添加新的自定义字段。我上面描述的是许多有经验的PSI开发人员使用的众所周知的模式。

The bottom line is that you cannot use an existing ProjectDataSet to add new custom fields. What I described above is a well known pattern used by many experienced PSI developers.

更多推荐

无法使用PSI更新项目自定义字段。

本文发布于:2023-10-27 03:08:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532134.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   字段   项目   PSI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!