Okay Lets try couple of option and let me know how it goes. If you solve mark the answer and like.
To integrate Dynamics 365 Time Entry records with Project Online timesheets, use a combination of Power Automate and Project Online’s REST API. Here’s a structured approach:
1. Power Automate Setup
Use the Project Online connector to authenticate and interact with your PWA site. Key steps:
-
Trigger: Use "When a row is added, modified, or deleted" for your Time Entry table.
-
Authentication: Configure the Project Online connector with your PWA root site URL (e.g., https://[tenant].sharepoint.com/sites/pwa).
2. REST API Integration
For timesheet operations, use HTTP actions targeting Project Online’s REST endpoints:
-
Create/Update Timesheets:
https://[tenant].sharepoint.com/sites/pwa/_api/ProjectServer/TimeSheet/Entries('[AssignmentID]')/Hours('[Date]')
-
Headers:
{"Content-Type": "application/json","X-RequestDigest": "[DigestValue]"}
-
Body:
{"Hours": "[DynamicsTimeEntry.Hours]","Comment": "[DynamicsTimeEntry.Notes]"}
-
Replace [AssignmentID] with the PWA Task GUID from your Dynamics Task table.
3. Key Components
-
Timesheet Period Handling:First, retrieve the active timesheet period using:
GET https://[tenant].sharepoint.com/sites/pwa/_api/ProjectServer/TimeSheetPeriods
Use the PeriodId in subsequent calls.
-
Assignment Validation:Ensure the Task’s PWA GUID matches a valid Project Online assignment. Use:
GET https://[tenant].sharepoint.com/sites/pwa/_api/ProjectServer/Projects('[ProjectID]')/Assignments
4. Automation Workflow Example
1. **Trigger**: New Time Entry created in Dynamics.
2. **Get PWA Assignment**: Match Dynamics Task GUID to Project Online assignment.
3. **Check Timesheet Period**: Ensure the entry date falls within an active period.
4. **Submit Hours**: Use the `PATCH` request above to update timesheet hours.
5. **Error Handling**: Log failures to a separate list for reconciliation.
5. Documentation & Samples
-
-
Power Automate Example: Adaptive Cards integration for timesheet reminders.
-