Skip to main content

Notifications

Community site session details

Community site session details

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

BadRequest_MethodNotAllowed

(1) ShareShare
ReportReport
Posted on by 106
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
    106 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
    81,422 Super User 2025 Season 1 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
    331 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,125 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,871 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans