web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Custom Connector Error - PATCH Requests of EdmType Collection are not allowed

(0) ShareShare
ReportReport
Posted on by

I have successfully created a custom connector for business central and am able to run GET and POST requests without issue, however I receive the following error when attempting a PATCH request:

{
"error": {
"code": "BadRequest_MethodNotAllowed",
"message": "'PATCH' requests for 'JobTasks' of EdmType 'Collection' are not allowed within Dynamics 365 Business Central OData web services. CorrelationId: 54147e03-7d2f-4eb1-9b4a-acab95a233c3."
}
}

After reviewing other threads such as this, I'm unable to solve the issue. Here's a screenshot of what my definition looks like - as you can see the eTag for the record I am attempting to update is being passed in the header and has been formatted properly with \-escapes removed.


pastedimage1626278166298v1.png

Additionally, if I change the If-Match etag to the improperly formatted value (W\/"JzQ0O3JaQjNzZFo0eGUyVVppV1lBdFg1QUpIOTRmS2g2NUE1UVlHYm82LzJ3czg9MTswMDsn\") I get a different error:

{
"error": {
"code": "RequestDataInvalid",
"message": "Request data is invalid."
}
}

Any advice? I've spent several hours sifting through similar issues but still seem to get the EdmType Collection error.

I have the same question (0)
  • JAngle Profile Picture
    133 on at

    Not sure your company Id will work - usually a guid. This might help you: https://youtu.be/6VUNCVKCwM4

    Worth considering if SaaS then you don’t need to create a custom connector.

  • Community Member Profile Picture
    on at

    The company ID is just to properly build out the request URL and works the same on GET requests without issue. I understand the idea of passing a unique identifier other than the eTag but unfortunately there is no other ID / GUID for the record. Here is an example of the Job Tasks response:

    {
          "@odata.etag": "W/\"JzQ0O3JaQjNzZFo0eGUyVVppV1lBdFg1QUpIOTRmS2g2NUE1UVlHYm82LzJ3czg9MTswMDsn\"",
          "Job_No": "J00001",
          "Job_Task_No": "010.00",
          "Predecessor": "",
          "Description": "Receive Permit Deposit",
          "Description_2": "Permitting - Yes",
          "Duration": "1D",
          "Job_Completed": false,
          "Global_Dimension_3_Code": "",
          "Job_Task_Type": "Posting",
          "Totaling": "",
          "Job_Posting_Group": "JOBS",
          "WIP_Total": "Total",
          "WIP_Method": "COST VALUE",
          "Start_Date": "2021-06-02",
          "End_Date": "2021-06-02",
          "Schedule_Total_Cost": 41.6,
          "Schedule_Total_Price": 0,
          "Usage_Total_Cost": 0,
          "Usage_Total_Price": 0,
          "Contract_Total_Cost": 41.6,
          "Contract_Total_Price": 0,
          "Contract_Invoiced_Cost": 0,
          "Contract_Invoiced_Price": 0,
          "Remaining_Total_Cost": 41.6,
          "Remaining_Total_Price": 0,
          "EAC_Total_Cost": 41.6,
          "EAC_Total_Price": 0,
          "Global_Dimension_1_Code": "FINANCE",
          "Global_Dimension_2_Code": "",
          "Outstanding_Orders": 0,
          "Amt_Rcd_Not_Invoiced": 0,
          "Planning_Date_Filter": "",
          "Posting_Date_Filter": ""
        }

    I have also tried leaving the If-Match value in the header to * and instead using oData filter to select the record by the eTag but receive the same 405 response.

  • Verified answer
    Community Member Profile Picture
    on at
    [quote user="Josh Anglesea"]

    Not sure your company Id will work - usually a guid. This might help you: https://youtu.be/6VUNCVKCwM4

    Worth considering if SaaS then you don’t need to create a custom connector.

    [/quote]

    Was able to solve it using a similar method! I took some guesses at what columns were keys to the table I was attempting to patch (they wound up being job_no and job_task_no in the case of the Job Tasks table) and used them as parameters of the endpoint.

    https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environmentName}/ODataV4/Company({companyId})/JobTasks({jobNo},{jobTaskNo})

    Then I ignored the If-Match header altogther with If-Match = * (set the default value to * as well in the connector so I don't have to declare it with every request)

    Now in the body I simply roll the value I want to update in a JSON object and success!!!

    Thank you, hopefully this info can help the next person.

  • Verified answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing final answer!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans