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

Community site session details

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

ve

(1) ShareShare
ReportReport
Posted on by 18
Hello,
 
I have used ODATA service to get details of 'NoSeriesLines' of VEND , it is working fine.
 
I want to update the Last_No_Used in NoSeriesLines (as shown in highlighted image) using below code
 
                string updateUrl = "https://api.businesscentral.dynamics.com/v2.0/acb64e3567a44d24e/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/NoSeriesLines?$filter=Series_Code eq 'VEND'";        
    
// Construct the HTTP request
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(updateUrl);
request.ContentType = "application/json";
request.Method = "PATCH"; // Use PATCH for updating records
// Add authorization header
request.Headers.Add("Authorization", "Bearer " + authToken);
// JSON payload for updating Last_No_Used
string jsonPayload = @"
{
    ""Last_No_Used"": Last_No_Used
}";
 
 
but, it is giving error of 'The remote server returned an error: (405) Method Not Allowed.', as per error looks like ODATA web service I am using for update record is not correct.
 
Please help me to find the correct ODATA webservice page to update the records in NoSeries in BC.
I have the same question (0)
  • Suggested answer
    Vahid Ghafarpour Profile Picture
    12,068 Super User 2025 Season 2 on at
    ve
    Ensure that the OData service endpoint supports the HTTP method you’re using. In Business Central, certain endpoints might only support GET and POST methods, not PATCH or PUT.
     
     

    ** Please don't forget to close up the thread here by Like and verify it as an answer if it is helpful **

     

  • Suggested answer
    YUN ZHU Profile Picture
    95,307 Super User 2025 Season 2 on at
    ve
    Hi, It looks like you published this page directly to the Web Service
    Unfortunately, this field is a variable and Editable is false, so it cannot be edited.
     
    You can choose to create a new list page and publish it to the Web Service, or create an API page.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Ramiz Profile Picture
    597 on at
    ve
    Hi,

    Hope this helps.

    https://yzhums.com/38278/
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,078 Most Valuable Professional on at

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,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans