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...
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 ?

  • Sylvain Martens Profile Picture
    Sylvain Martens 15 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

    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.

  • JAngle Profile Picture
    JAngle 63 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

    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
    Sylvain Martens 15 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

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

  • Sylvain Martens Profile Picture
    Sylvain Martens 15 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

    BUMP.

  • Sylvain Martens Profile Picture
    Sylvain Martens 15 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

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

  • JAngle Profile Picture
    JAngle 63 on at
    RE: [NAV][ODataV4] Having hard time deleting a customer custom price from API

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans