Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

BadRequest_MethodNotAllowed

Posted on by 86
When Posting a dimensionSetLines I am getting the following error message'
 
"error": {
    "code": "BadRequest_MethodNotAllowed",
    "message": "'POST' requests for 'dimensionSetLines' of EdmType 'Entity' are not allowed within Dynamics 365 Business Central OData web services."
 
The post request looks like:
 
 
 Dim postdataje As New JObject
 postdataje.Add("id", "fce3b93e-5ce6-ee11-a201-6045bdc89dad")     'id of dimension
 postdataje.Add("code", "DEPARTMENT")
 postdataje.Add("parentId", "2588145e-9029-ef11-9f88-000d3a708259")   ''id of jourrnal
 postdataje.Add("parentType", "Journal Line")    
 postdataje.Add("displayName", "Department")
 postdataje.Add("valueId", "17b4ffa1-511f-ef11-9f88-000d3a74de60")   ''id of dimension value 
 postdataje.Add("valueCode", "CHEM")
 postdataje.Add("valueDisplayName", "Chemistry")
 
I also set the request header to: 
 httpWebRequest.Headers.Add("OData-MaxVersion", "4.0")
 httpWebRequest.Headers.Add("OData-Version", "4.0")
 httpWebRequest.Headers.Add("if-match-to", "*")
 
Not sure how to solve thus  error message. Anyone have an idea to try?
 
Thanks
  • DS-15051354-0 Profile Picture
    DS-15051354-0 86 on at
    BadRequest_MethodNotAllowed
    I wanted to clarify what I am trying to do. I am not trying to add or modify an exist value for a dimension.
     
    What I want to do is after I enter a Journal Line I want to set the field called Department Code to one of the exist values already there. I need to be able to enter this code via an API. 
     
    I don't want to have to sign in to BC and go to that Journal Batch(then go to the Journal LIne) and have to select the Department Code manually. I need to select the value via an API if possible.
     
    I did not see the Department Code field in the add JournalLine so I'm trying to set this field by a API.
     
    So when I post this Journal it will contain the Department Code i entered.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 Super User 2024 Season 2 on at
    BadRequest_MethodNotAllowed
    I have tested it in Postman before, I hope the following information can give you some hints.
     
     
    Thanks.
    ZHU
  • Tech_BC_Gokul Profile Picture
    Tech_BC_Gokul 295 on at
    BadRequest_MethodNotAllowed
    Hi 
     
    dimension set lines are only view pages it’s a temporary load data please use dimension field in journal line table if the values are for the shortcut dimension 1/2 
     
    other dimensions please use the custom variables in the journal pages 
     
    thanks 
    gokulnath

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans