Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Custom API Not Working Properly in BC

Posted on by 4
I have created a custom API which extends from the Items API in Business Central, it adds a few new fields like Market Industry and ProductFamily etc,
 
as suggested by a few other posts, I have followed https://www.kauffmann.nl/2021/03/12/extending-standard-apis-1/ in order to create my custom API, however after I finished everything and ran the API I got the error that //The field name 'SomeCustomField' can only appear once in the table 'Item'. The field is declared in multiple apps with IDs: 'xyxyxyxyxy'...//
 
I'm not sure why I am getting this error and i'm not sure what it means.
 
Here is the code for one custom field
 
API File
 
                field(MarketIndustry; Rec.MarketIndustry)
                {
                    Caption = 'Market Industry';
                    trigger OnValidate()
                    begin
                        RegisterFieldSet(Rec.FieldNo(MarketIndustry));
                    end;
                }
 
Table Extension File
 
        field(60101; MarketIndustry; Text[30])
        {
            Caption = 'Market Industry';
        }
 
 
And for the custom fields that don't give errors, in Power Automate when I run a BC Automation they don't fill in any of the boxes/values when I run the Automation.
 
Categories:
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,125 Super User 2024 Season 2 on at
    Custom API Not Working Properly in BC
    As per the error, the field is declared in multiple apps so please check those apps and keep the field in just one of those apps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans