LookupTable.CreateLookupTables 方法
创建自定义域查阅表格和对应的代码掩码。
命名空间: WebSvcLookupTable
程序集: ProjectServerServices(位于 ProjectServerServices.dll 中)
语法
声明
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/LookupTable/CreateLookupTables", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/LookupTable/", _
ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/LookupTable/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub CreateLookupTables ( _
ltds As LookupTableDataSet, _
validateOnly As Boolean, _
autoCheckIn As Boolean _
)
用法
Dim instance As LookupTable
Dim ltds As LookupTableDataSet
Dim validateOnly As Boolean
Dim autoCheckIn As Boolean
instance.CreateLookupTables(ltds, validateOnly, _
autoCheckIn)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/LookupTable/CreateLookupTables", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/LookupTable/",
ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/LookupTable/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void CreateLookupTables(
LookupTableDataSet ltds,
bool validateOnly,
bool autoCheckIn
)
参数
ltds
类型:WebSvcLookupTable.LookupTableDataSetLookupTableDataSet包含数据表中的数据。
validateOnly
类型:System.Boolean仅验证,请不要创建。
autoCheckIn
类型:System.Boolean如果true,签入后创建。
备注
If you create a non-text lookup table such as type Cost, Date, Duration, or Number, you still need to programmatically create a code mask. Project Web App hides the code mask for non-text lookup tables in the New Lookup Table page, but creates a code mask for the call to CreateLookupTable. For an example that creates a Duration lookup table, see CreateLookupTablesMultiLang. For more examples, see Using the ProjTool Test Application.
CreateLookupTables的前事件是LookupTableEventReceiver.OnCreating和后期事件是OnCreated。
备注
前和后期事件CreateLookupTables公开LookupTableMultiLangDataSet事件处理程序,而不是LookupTableDataSet的e参数中。
To use datasets in event handlers, set a reference to the Microsoft.Office.Project.Schema.dll assembly. For more information, see How to: Write and Debug a Project Server Event Handler. For more examples, see Using the ProjTool Test Application.
警告
当您使用 PSI 创建或更新的号码的查阅表格时,不要添加具有两个以上小数位的值。
CreateLookupTables方法,可以保存的两个以上小数位的数字。创建使用号码的查阅表格的自定义字段时, Project Professional 2010舍入为两个小数位的数字自定义域值,并显示它们以在下拉列表中选择一个值的字符串。选择一个值时, Project Professional 2010将字符串转换回数字。进程显示错误,因为不存在的只有两个小数位的数字值。
Project Server 权限
权限 |
说明 |
---|---|
允许用户修改企业自定义域和查阅表格值的定义。全局权限。 |
示例
下面的代码是前期事件处理程序从不同表LookupTableMultiLanguageDataSet中获取数据的CreateLookupTables 。
using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public class LookupTableEvents : LookupTableEventReceiver
{
public override void OnCreating(PSLibrary.PSContextInfo contextInfo,
LookupTablePreEventArgs e)
{
int lutLanguage =
(int)e.LookupTableInformation.LookupTableLanguages.Rows[0]["LCID"];
Guid lutMultiUid =
(Guid)e.LookupTableInformation.LookupTables.Rows[0]["LT_UID"];
string lutMultiValue =
(string)e.LookupTableInformation.LookupTableValues.Rows[0]["LT_VALUE_TEXT"];
. . .
}