MS Project Online (CSOM) читает значение настраиваемого поляC#

Место общения программистов C#
Anonymous
MS Project Online (CSOM) читает значение настраиваемого поля

Сообщение Anonymous »

Я хочу получить значение настраиваемого поля проекта с помощью CSOM.
У меня есть простая функция для чтения имени проекта и его настраиваемых полей.
При вызове context. Load(project, x=> x[customField.InternalName]); выдает исключение

Код: Выделить всё

The query expression 'x.get_Item(value(ProjectOnline_PWA.Form1+c__DisplayClass3_0).customField.InternalName)' is not supported.

Код: Выделить всё

private void ReadProjects(ProjectContext context)
{
context.Load(context.Projects);
context.ExecuteQuery();

PrintInfoText("==============Projects===============");
foreach (PublishedProject project in context.Projects)
{
PrintInfoText("ID:" + project.Id);
PrintInfoText("Name:" + project.Name);

PrintInfoText("CustomFields:");
context.Load(project.CustomFields);
context.ExecuteQuery();
foreach (var customField in project.CustomFields)
{
PrintInfoText("    customField_ID:" + customField.Id);
PrintInfoText("    customField_Name:" + customField.Name);
PrintInfoText("    customField_InternalName:" + customField.InternalName);
context.Load(project, x=> x[customField.InternalName]);
context.ExecuteQuery();
PrintInfoText("    customField_Value:" + project[customField.InternalName]);
}

PrintInfoText("====================================");
}
PrintInfoText("==============End_Projects=============");
}
Может ли кто-нибудь посоветовать, как извлечь значение настраиваемого поля?

Подробнее здесь: https://stackoverflow.com/questions/790 ... ield-value

Вернуться в «C#»