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

BC returns error when trying to create a subscription to an endpoint based on table "BOM Component"

(0) ShareShare
ReportReport
Posted on by 5

Hi guys,

I have created a custom API based on "BOM Component" table and when I try to create a webhook (subscription) within an external service I receive the following error:

pastedimage1616081334905v1.png

This is the definition of the Api page:
pastedimage1616081508225v2.png

I have other API Pages published in the same enviroment, based on other tables a everithing work ok, except this one.

Any ideas?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: BC returns error when trying to create a subscription to an endpoint based on table "BOM Component"

    True. Missed that in your code, sorry.

  • Suggested answer
    Claudio Lagoa Profile Picture
    5 on at
    RE: BC returns error when trying to create a subscription to an endpoint based on table "BOM Component"
    Hi again, 

    I've been talking to Microsoft Support and It seems that you can't create API subscription with a composite primary key.
    In this case, It was using the primary key of the "BOM Component" table, which is: "Parent Item No.", "Line No.".
    
    The solution was simple, just add the SystemId field to the page and set it as OdataKeyFields.

    pastedimage1616584622005v1.png
  • Claudio Lagoa Profile Picture
    5 on at
    RE: BC returns error when trying to create a subscription to an endpoint based on table "BOM Component"

    Thanks for your reply Stefano,

    I have performed the test that you have told me. I have removed the DataAccesIntent = ReadOnly property and it keeps returning the same error.

    On the other hand, I confirm that the subscription works with other models and with the DataAccesIntent = ReadOnly property.

    I have done the test on the Production version and a clean Sandbox in the latest version (17.5.22499.22680).

  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: BC returns error when trying to create a subscription to an endpoint based on table "BOM Component"

    Not sure, but here you have DataAccessIntent = ReadOnly. Never tested if subscriptions work on the reas-only replica. Can you test without this?

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
Sohail Ahmed Profile Picture

Sohail Ahmed 691

#2
YUN ZHU Profile Picture

YUN ZHU 682 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 529

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans