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

Dynamics NAV 2018 web services/odata purchase order line

(0) ShareShare
ReportReport
Posted on by 5

Using web services and OData V4 and c# Connected Services I am trying to create a new purchase order line and add it to an existing purchase order.  I am able to update existing purchase order line such as the quantity, however when trying to create a new line all I get is the error:

DataServiceClientException: {"error":{"code":"BadRequest_InvalidOperation","message":"Control 'Unit of Measure Code' is read-only."}}

I am not even trying to change/set the field value, however nothing I have tried can get me past this error whether I set it or not it seems the SaveChanges() is trying to alter the value anyway causing the error.  I wanted to check here if I am missing an option as I do not want to get a developer involved.

  • webster Profile Picture
    5 on at
    RE: Dynamics NAV 2018 web services/odata purchase order line

    Update: I figured a way to get past this one field.  Creating a second item unit of measure for the item being added allows the field to be editable.  Of course now I am getting:

    DataServiceClientException: {"error":{"code":"BadRequest_InvalidOperation","message":"Control 'Total Amount Excl. VAT' is read-only."}}

    The question really becomes, if the field(s) are read-only, how do I get the web service to update the calculated fields so it does not consider me altering read-only fields?

  • webster Profile Picture
    5 on at
    RE: Dynamics NAV 2018 web services/odata purchase order line

    Thank you for the suggestion, but is that variable set inside the Dynamics IDE - page?  I don't have a developer license.

  • Suggested answer
    Jyotsna NAV Profile Picture
    585 on at
    RE: Dynamics NAV 2018 web services/odata purchase order line

    In Purchase Order Subform, the Editable property of UoM is controlled by a variable(UnitofMeasureCodeIsChangeable). Check this method UpdateEditableOnRow()

    See if it is failing some condition or if it is required to see the variable to TRUE, always.

    Regards

    Jyotsna

    jyotsnanav.blogspot.com

    Don't forget to help the community by verifying my answer or at least like the suggestion if it did help in any way. It will let others know that the topic has a verified answer and was beneficial to you.

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 Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2025 Season 1

#2
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 347

#3
Mansi Soni Profile Picture

Mansi Soni 327

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans