none
Project Server setting (Custom Fields and Lookup Tables) RRS feed

  • Question

  • Hi,

          I'm using ReadCustomFields(String.Empty,false) and ReadLookupTable(String.Empty,false,0) for reading all the CustomFields and Lookuptables from the PS Server settings using PSI, but I'm not getting the expected output instead I'm getting SOAPException and 401 error on both the functions.

          Could any one update the code to reading the CustomFields and LookupTables.

    Code for Lookup Tables 

    using (LookupTableWS.LookupTableDataSet lookupTablesDataSet = lookupTable.ReadLookupTables(String.Empty, false,0))  ---> error in this line
                {
                    foreach (LookupTableWS.LookupTableDataSet.LookupTableRow group in lookupTablesDataSet.LookupTables.Rows)
                    {
                        string ddlTitleClass = group.MD_PROP_NAME.ToString();
                     }
                }

    Code for Custom Fields 

    using (CustomFieldsWS.CustomFieldsDataSet customFieldsDataSet = customFields.ReadCustomFields(String.Empty, false))---> error in this line
                {
                    foreach (CustomFieldsWS.CustomFieldDataSet.CustomFieldsRow group in customFieldsDataSet .CustomFieldsRow .Rows)
                    {
                        string ddlTitleClass = group.MD_PROP_NAME.ToString();
                     }
                }

    Thanks

    -Bob

    Friday, August 27, 2010 2:53 PM

All replies

  • Hi Bob, 

    i 'm using this code to read Lookup tables and custom task fields: 

    LookUp Tables

    LookupTablaDataSet lookupTableDataSet = lookupTableWS.ReadLookupTables("", false, 1033);

    Guid tableGuid = getTableGuid(tableName, lookupTableDataSet.LookupTables);//create this method

    DataView dvTable = new DataView(lookupTableDataSet.LookupTableTrees); dvTable.RowFilter = "LT_UID = ' " + tableGuid + " ' "; if (dvTable != null) { dt = new List<string>(); foreach (DataRowView drv in dvTable){

    string drv["LT_VALUE_TEXT"].ToString();

        }

    }

     

    Custom field:

    Guid taskGuid = new Guid(PSLib.EntityCollection.Entities.TaskEntity.UniqueId.ToString());

             CustomFieldDataSet mycustomDS = customFieldsWS.ReadCustomFieldsByEntity(taskGuid);

           DataView dataview = new DataView(mycustomDS.CustomFields);

             for (int i = 0; i < dataview.Count; i++){ 

    string ddTitleClass = drv.Row["MD_PROP_NAME"].ToString();

    }

     

    Regards,

     


    Jorge
    [ The ultimate for Project Server 2007 || http://www.projecttimesheet.com/about-en.php ]
    Monday, August 30, 2010 7:08 AM