3

I'm blocked with calling getTaskFieldAsync API to read some fields required for my solution.

Expected Behavior

getTaskFieldAsync must successfully return field value for valid task ID

Current Behavior

getTaskFieldAsync returns error:

{ code: [1,2], name: "Internal Error", message: "An internal error has occurred." }

I checked all fields in Office.ProjectTaskFields enum and found that same error happens for next fields:

  1. Office.ProjectTaskFields.Type
  2. Office.ProjectTaskFields.Status
  3. Office.ProjectTaskFields.Priority
  4. Office.ProjectTaskFields.PercentWorkComplete
  5. Office.ProjectTaskFields.PercentComplete
  6. Office.ProjectTaskFields.OutlineLevel
  7. Office.ProjectTaskFields.FixedCostAccrual
  8. Office.ProjectTaskFields.EarnedValueMethod
  9. Office.ProjectTaskFields.ConstraintType
  10. Office.ProjectTaskFields.Baseline1FixedCostAccrual

In addition Summary field always has false value, even if Task has subtasks - i can report this as separate ticket if required.

Steps to Reproduce

  1. Create empty project
  2. Create Task (fill subject) at 1 index and get its GUID (using VBA for instance) or call getTaskByIndexAsync
  3. Call getTaskFieldAsync with task id and one of the field id listed above.

Here is pseudo code (callbacks wrapped with promises):

  1. let id = await Office.context.document.getTaskByIndexAsync(1);
  2. let outlinelevel = await Office.context.document.getTaskFieldAsync(id, Office.ProjectTaskFields.OutlineLevel); // Error here

Note this that same sequence of calls works for other fields (not listed above).

Context

This is Office Addin Hosted by Project. Code executed in context of HTML button click handler.

Environment

Host: Microsoft Project (Desktop) Office version number: Microsoft Project 2019 version 1912 (build 12325.20298 Click-to-Run) MSO 16.0.12325.20280 Operating System: Windows 10 (1909 build 18363.535)

FYI: This is a clone for the issue posted to Github.

Thanks.

0 Answers0