Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Schedule API for Project Task issue (msdyn_PssCreateV1)

Posted on by Microsoft Employee

I have been testing the Project and Project Task creation APIs and found what I believe to be an odd bug.  Has anyone else experienced this?

I am creating projects via the msdyn_CreateProjectV1 Action.  That is working fine.

I am then trying to add Project Tasks to the above projects (using 

msdyn_CreateOperationSetV1

msdyn_PssCreateV1

msdyn_ExecuteOperationSetV1)

and having mixed results with sometimes it working and other times the operationset is Pending.  I have been able to recreate this as follows:

 

  1. Scenario 1:
    1. Create the Project using API (msdyn_CreateProjectV1)
    2. WITHOUT going to the model app Project and opening Task Tab,
      1. create Project Tasks using API (no errors so different from Scenario 2)
    3. RESULT: OperationSet is Pending and tasks are not created
  2. Scenario 2:
    1. Create the Project using the New button in the Model App.
    2. WITHOUT going to the model app Project and opening Task Tab,
      1. create the Project Tasks using the API
    3. RESULT: ERROR on GetDefaultBucket query (per sample code docs.microsoft.com/.../schedule-api-preview)
      1. - Exception Message: Please open project with id 2589ac45-0df6-eb11-94ef-0022481e1656 in the Dynamics UI and navigate to the Tasks tab
    4. Go to Project in model app and open Task tab and wait for it to open
    5. Close Project form in model app.
    6. Re-run the create of Project Tasks using the API
    7. RESULT: OperationSet is Complete and tasks are created as expected
  3. Scenario 3:
    1. Create the Project using API (msdyn_CreateProjectV1)
    2. Go to Project in Model app and click on the Task tab. Close form after Task tab loads.
    3. create Project Tasks using API
    4. RESULT: OperationSet is Complete  and tasks are created as expected

 

Can anyone explain this behavior and why it is “Pending” and what needs to be done to complete it?  If creating tasks for a Project, is there a pre-requisite that the Task tab must be opened in Model app form manually first?

pastedimage1628184664177v2.png

  • MattDC Profile Picture
    MattDC 24 on at
    Schedule API for Project Task issue (msdyn_PssCreateV1)
    When using this structure, calling the API endpoint from a client side JavaScript app:
     
    ```
        const payload = {
            'Entity' : {
                'msdyn_LinkStatus'               : 192350000,
                'msdyn_subject'                  : 'test',
                'msdyn_start'                    : '2024-09-10T00:00:00Z',
                'msdyn_finish'                   : '2024-09-15T00:00:00Z',
                '@odata.type'                    : 'Microsoft.Dynamics.CRM.msdyn_projecttask',
                'msdyn_project@odata.bind'       : `msdyn_projects(${projectId})`,
                'msdyn_projectbucket@odata.bind' : `msdyn_projectbuckets(${projectBucketId})`
            },
            'OperationSetId' : operationSetId
        };
    ```
     
    I got an error:  `InnerException : Microsoft.Crm.CrmException: Invalid property 'msdyn_linkStatus' was found in entity`

    I removed the 'msdyn_LinkStatus' then it worked.

    It's unfortunate that Microsoft Project can't be accessed using Microsoft Graph. 




     
  • taral Profile Picture
    taral 196 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Hey Antii,

    Issue got resolved by following your link i have added one another step of abondonprocess.

    Thanks for suggestions.

    Regards,

    Taral Shah

  • apa Profile Picture
    apa 8,282 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    That means that there are 10 open OperationSets for the user:
    https://docs.microsoft.com/en-us/dynamics365/project-operations/project-management/schedule-api-preview#limitations-and-known-issues

    You need to either abandon them manually or wait for the OOTB flows Project Service Core - Abandon Open Operation Sets or Project Service Core - Abandon Pending Operation Set to run.

  • taral Profile Picture
    taral 196 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Hello Antti,

    The issue got resolved by your answer but now while creating OperationSet i'm getting below error in MS flow.

    "ScheduleAPI-OV-0004:00000000-0000-0000-0000-000000000000: The maximum number of operation set allowed per user is 10."

    pastedimage1644821848669v1.png

  • apa Profile Picture
    apa 8,282 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    That error is given when an OperationsSet is created by user a) and called by user b). You have to create and call with the same user.

  • taral Profile Picture
    taral 196 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Hello Antti,

    i have done changes as per your recomnedations and error resolved.

    but getting below error while running the flow.

    {
      "error": {
        "code""0x80040265",
        "message""ScheduleAPI-OV-0006:fc98dff7-818a-ec11-93b0-6045bdaa978f: The current user with AADId 988e6660-0f0c-4792-a48d-e7dd7aeafbab is different from the owner with AADId 54b41df7-52a4-4b33-9c85-c7362e97d6f0 of the operation set."
      }
    }
    pastedimage1644505204352v1.png

    Can you suggest what can be the issue?

  • Suggested answer
    apa Profile Picture
    apa 8,282 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Hi Taral Shah.

    I can see two things there in the JSON:

    • msdyn_activitynumber. That's most likely whole number column so it doesn't require quotes. Instead of "1" just punch in 1.
    • The actual error in the JSON is probably because of the @ sign with the @odata.type property. You need to escape it with another @. I.e. punch in @@odata.type. Another options is to store @odata.type in a a compose action in which case you don't need to escape the @.

    {
        "Entity": {
          "msdyn_LinkStatus": 192350000,
          "msdyn_subject": "taskSubjectHere",
          "msdyn_start": "yyyy-MM-ddTHH:mm:ssZ",
          "msdyn_finish": "yyyy-MM-ddTHH:mm:ssZ",
          "@@odata.type": "Microsoft.Dynamics.CRM.msdyn_projecttask",
          "msdyn_project@odata.bind": "msdyn_projects(projectGuidHere)",
          "msdyn_projectbucket@odata.bind": "msdyn_projectbuckets(bucketGuidHere)"
        },
        "OperationSetId": "operationSetIdHere"
      }

  • taral Profile Picture
    taral 196 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Hello Antii,

    I 'm creating project tasks using Flow using below article

    daytodaydynamics365.com/.../

    in my scenario project task will be multiple so when i'm trying to generate tasks using psscreatev1 command in apply to each step.

    the flow gives below error and not able to save the flow.

    pastedimage1644501274069v1.png

    Below are my steps of the flow.

    pastedimage1644501306733v2.png

    pastedimage1644501320058v3.png

    pastedimage1644501330272v4.png

    can you suggest what can be the issue.

  • apa Profile Picture
    apa 8,282 on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    I'd repro the scenario in Postman and if it doesn't work, open a service request. At least in my geo the APIs are working when called from custom connectors.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Schedule API for Project Task issue (msdyn_PssCreateV1)

    Thanks - I had seen your post before and was very useful.  I am using a C# plugin triggered from a custom entity populated by a integration job for our POC testing rather than PowerAutomate but when we move to PA I'm sure it will be very useful.  

    Since my Scenario 3 works and Scenario 1 does not and only difference is opening the Task tab, I think this is MSFT bug.  I am following the process you mentioned and have not been able to find any documentation on what the OperationSet status of "Pending" means so will raise ticket with MSFT.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans