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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

[NAV][ODataV4] Having hard time deleting a customer custom price from API

(0) ShareShare
ReportReport
Posted on by 15

Hello i am trying to delete a Sales Prices, i use entity #7002

When ever i pass parameters in the URL i get Bad Request - Error in query syntax. and without parameters i get a collection which isnt deletable.

The URL looks like this: https://nav.domain.com:7048/NAV/ODataV4/Company('TESTJL')/SalesPrices


And with parameters like this: nav.domain.com:7048/.../SalesPrices(Item_No='C-MONITORING',Sales_Type='Customer',Sales_Code='752')


I include in the headers

If-Match:

W/"JzEyNDtXaHNBQUFKNy8wTUFMUUJOQUU4QVRnQkpBRlFBVHdCU0FFa0FUZ0JIQUFBQUFJc0FBQUFBQW5zRE53QTFBRElBQUFBQUxnQUFBQUFDZXdBQUFBSjdBQUFBQW52L1ZRQk9BQUFBQURJQUFBQUFBQUFBQUFBQUFBQUFBQT09ODsxNTM1MTgwMzA7Jw=="

Anyone has any idea ?

I have the same question (0)
  • JAngle Profile Picture
    159 on at

    I believe it is expecting you to work with the primary key of the table. For sales price it is a long one:

    Key; "Item No.", "Sales Type", "Sales Code", "Starting Date", "Currency Code", "Variant Code", "Unit of Measure Code", "Minimum Quantity"

    So for the query you don’t need to mention the field names you just need to provide the values. As text values where necessary so use single quotes on that data type. You can pass blanks where you don’t have the data or it isn’t relevant to your scenario.

  • Sylvain Martens Profile Picture
    15 on at

    Same issue (error in query syntax) using: SalesPrices('C-MONITORING','Customer','752','0001-01-01','','','UN',0)

  • Sylvain Martens Profile Picture
    15 on at

    BUMP.

  • Sylvain Martens Profile Picture
    15 on at

    Bump. this is a progress blocker and i really cant figure out the issue with this entity.

  • JAngle Profile Picture
    159 on at

    Not sure what the bump comments are about.

    It’s not something I have tried so easily missing some detail. An alternative which might work out better. Create a codeunit that does the deletion. The codeunit can be called as a web service. You can set it so it accepts a certain amount of parameters, so the data you are feeding right now. Codeunit would then set filters on the table based on that data and delete. Would be a POST command in this instance.

  • Sylvain Martens Profile Picture
    15 on at

    For the purpose of my application i cannot create custom codeunit's because the goal is to have a plug and play platform that handle contracts managements.

    This is the last bit that got me stuck with NAV integration, which is to be able to update prices on contract renewal.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,497 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,778 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,507

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans