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:
- Office.ProjectTaskFields.Type
- Office.ProjectTaskFields.Status
- Office.ProjectTaskFields.Priority
- Office.ProjectTaskFields.PercentWorkComplete
- Office.ProjectTaskFields.PercentComplete
- Office.ProjectTaskFields.OutlineLevel
- Office.ProjectTaskFields.FixedCostAccrual
- Office.ProjectTaskFields.EarnedValueMethod
- Office.ProjectTaskFields.ConstraintType
- 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
- Create empty project
- Create Task (fill subject) at 1 index and get its GUID (using VBA for instance) or call getTaskByIndexAsync
- Call getTaskFieldAsync with task id and one of the field id listed above.
Here is pseudo code (callbacks wrapped with promises):
- let id = await Office.context.document.getTaskByIndexAsync(1);
- 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.