0

I need to update Custom field that refer to lookup and allow multiple values to be selected in sharepoint. I am using the code below to update custom field but allow single line of text :

 ProjCFRow.CODE_VALUE = new Guid(rowLTT["LT_STRUCT_UID"].ToString());

or add it to project like :

 rowProjCF = projectDs.ProjectCustomFields.NewProjectCustomFieldsRow();
                                        rowProjCF.PROJ_UID = projectId;
                                        rowProjCF.CUSTOM_FIELD_UID = Guid.NewGuid();
                                        rowProjCF.FIELD_TYPE_ENUM = (byte)PSLibrary.CustomField.Type.TEXT;
                                        rowProjCF.CODE_VALUE = new Guid(rowLTT["LT_STRUCT_UID"].ToString());
                                        rowProjCF.MD_PROP_UID = x.Key;
                                        rowProjCF.MD_PROP_ID = cfRow.MD_PROP_ID;
                                        dtProjCustomFiled.AddProjectCustomFieldsRow(rowProjCF);

How can I do it ?

Rubén
  • 34,714
  • 9
  • 70
  • 166
Mounir
  • 281
  • 3
  • 10
  • 25

1 Answers1

0
if (SingleprojectDS.ProjectCustomFields.Select("MD_PROP_UID = '" + CFGuid + "'").Length == 0)
                {
                    ProjectDataSet.ProjectCustomFieldsRow FunctionCFRow = ProjDS.ProjectCustomFields.NewProjectCustomFieldsRow();
                    FunctionCFRow.PROJ_UID = ProjectGuid;
                    FunctionCFRow.MD_PROP_UID = CFGuid;
                    FunctionCFRow.CUSTOM_FIELD_UID = Guid.NewGuid();
                    FunctionCFRow.TEXT_VALUE = Value;
                    ProjDS.ProjectCustomFields.AddProjectCustomFieldsRow(FunctionCFRow);
                }

For Complete post http://projectservercode.com/update-custom-field-using-psi/