Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Unknown Error when trying to create a lookup table using CSOM and C# (Project Server 2013 Cloud - Office 365)

$
0
0
Hi,

I have been trying for the last (almost) week, to create a lookup table in Project Server 2013 (Cloud based on Office 365) using CSOM and C#.

I have been able to add entries to existing lookup tables, create custom fields and resources without any issues (using CSOM and C#).

I have the problem when trying to create the Lookup Table using the LookupTableCreationInformation object.  I fill the properties (have tried various combinations) and attempt to add to the LookupTable objects.

The error is raised when I run the ExecuteQuery() after preparing the objects.  The Error returned is "Unknown Error", with an error code -1.

Example Code:
    List<LookupMask> masks = new List<LookupMask>();
    LookupMask mask1 = new LookupMask();
    mask1.Separator = ".";
    mask1.Length = 0;
    mask1.MaskType = LookupTableMaskSequence.CHARACTERS;

    masks.Add(mask1);
    
    LookupTableCreationInformation ltci = new LookupTableCreationInformation();                

    ltci.Id = Guid.NewGuid();
    ltci.Name = "MyLookupTable";
    ltci.Masks = masks;                

    ltci.SortOrder = LookupTableSortOrder.Ascending;
    
    LookupTable table = pContext.LookupTables.Add(ltci);
    pContext.LookupTables.Update();
    
    pContext.ExecuteQuery();
   
Error Raised:

    Microsoft.SharePoint.Client.ServerException: Unknown Error
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
       at ProjectServer2013ExperimentApp.ProjectServer2013HelperClass.AddLookupTable(ProjectContext pContext, String lookupTableName) in z:\Project Server 2013 Cloud\ProjectServer2013ExperimentApp\ProjectServer2013ExperimentApp\ProjectServer2013HelperClass.cs:line 270
    
Has anyone been able to successfully create a lookup table using the CSOM components?  Any advice or examples would be very much appreciated.

Thanks in advance,

Steve

Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>