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

Updating an enterprise field

$
0
0

Platform is MSP 2007, connecting to Project Server. Code written in C#, VS 2010 + VSTO

I've found links and snippets of source code on this forum written by Rod Gill. They don't seem to work in my case.

The code is below:

PjField WorkCode;

Task newTask;

WorkCode = Application.FieldNameToFieldConstant("ERP Work Code", PjFieldType.pjTask);

newTask = ActiveProject.Tasks.Add("Work Task Example");

newTask.SetField(WorkCode, "WC"); // this Fails with "The argument is not valid" exception

// Also tried, also fails:

// ActiveProject.Tasks[newTask.Index].SetField(WorkCode, "WC");

Thanks for your help

Marc


Viewing all articles
Browse latest Browse all 5347

Trending Articles



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