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

Update Enterprise Custom Field

$
0
0

I need to update Enterprise Custom field from code behind. But, my custom field can contain only values from lookup table.

Custom Field Name: "Status"

Values from lookup that Custom Field can have: "S1", "S2", "S3".

Custom Field "Status" has value S1 and I need to change it to S2. How?

This how I get to my "Status" field

ProjectDataSet tProj = svcProject.ReadProjectEntities(projectUid, 32, DataStoreEnum.WorkingStore);

CustomFieldDataSet customFieldsDs = svcCustomFields.ReadCustomFields("", false);
 string guid = "";
CustomFieldDataSet.CustomFieldsDataTable cfDataTable =   customFieldsDs.CustomFields;
  for (int i = 0; i < cfDataTable.Count; i++)
  {
                         if (cfDataTable[i].MD_PROP_NAME == "Current Status")
                         {
                             Guid a = cfDataTable[i].MD_PROP_UID;
                             guid = a.ToString();

                         }
  }
  string tCurrentStatusStr = tCurrentStatusGuid.ToString();

  DataRow[] cfRows = tProj.ProjectCustomFields.Select(tProj.ProjectCustomFields.MD_PROP_UIDColumn.ColumnName + " = '" + guid + "'");

  string Lt_guid = cfRows[0].ItemArray[8].ToString();

In Lt_guid variable is guid of value from lookup table. How do I change that guid. Am I on the right track here?



Viewing all articles
Browse latest Browse all 5347

Trending Articles



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