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...
Suggested Answer

BadRequest_MethodNotAllowed

(1) ShareShare
ReportReport
Posted on by 152
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
I have the same question (0)
  • Dynamics_Decoded_Gokul Profile Picture
    463 on at
    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
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    I have tested it in Postman before, I hope the following information can give you some hints.
     
     
    Thanks.
    ZHU
  • DS-15051354-0 Profile Picture
    152 on at
    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.

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 2,126

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 744 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 674 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans