LookupTable.CreateLookupTables Method

Creates custom field lookup tables and corresponding code masks.

Namespace:  WebSvcLookupTable
Assembly:  ProjectServerWebServices (in ProjectServerWebServices.dll)

Syntax

'Declaration
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/LookupTable/CreateLookupTables", RequestNamespace := "http://schemas.microsoft.com/office/project/server/webservices/LookupTable/",  _
    ResponseNamespace := "http://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 _
)
'Usage
Dim instance As LookupTable
Dim ltds As LookupTableDataSet
Dim validateOnly As Boolean
Dim autoCheckIn As Boolean

instance.CreateLookupTables(ltds, validateOnly, _
    autoCheckIn)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/LookupTable/CreateLookupTables", RequestNamespace = "http://schemas.microsoft.com/office/project/server/webservices/LookupTable/", 
    ResponseNamespace = "http://schemas.microsoft.com/office/project/server/webservices/LookupTable/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void CreateLookupTables(
    LookupTableDataSet ltds,
    bool validateOnly,
    bool autoCheckIn
)

Parameters

Remarks

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 Access 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.

The pre-event for CreateLookupTables is LookupTableEventReceiver.OnCreating and the post-event is OnCreated.

Note

The pre- and post-events for CreateLookupTables expose LookupTableMultiLangDataSet in the e parameter of event handlers, rather than a LookupTableDataSet.

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.

Project Server Permissions

Permission

Description

ManageEnterpriseCustomFields

Modify the definitions of Enterprise custom fields and lookup table values. Global permission.

Examples

The following code is a pre-event handler for CreateLookupTables that gets data from different tables in a LookupTableMultiLanguageDataSet.

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"];
        . . .
}

See Also

Reference

LookupTable Class

LookupTable Members

WebSvcLookupTable Namespace

CreateLookupTablesMultiLang

Other Resources

How to: Write and Debug a Project Server Event Handler

Using the ProjTool Test Application