Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Hiding columns from table in OData API calls

Posted on by 4
We have a security problem with API access to our Business Central database.
We have a table that needs to be accessed by all employees.
That table contains Salary information fields that are hidden in BC but can be accessed via an OData API call from PowerBI or Excell.
I’m pretty sure our company wasn’t setup right, but API access must be maintained for reporting purposes and using linked tables is not a viable solution.
Applying security filters, from BC, to the specific fields doesn’t do the trick, since the hole line gets filtered, and we need it.  
Does anyone know how we can hide fields from API calls while the others, from the same line can still be read?
Thanks
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 14,611 User Group Leader on at
    Hiding columns from table in OData API calls
    Hi,
     
    You cannot change the field list exposed by a standard API.
     
    If it a custom API Endpoint created by your partner, you can ask them to remove fields that are sensitive and have a separate endpoint for specific people in team to access that data.
     
    If filters need to be applied on data that can also be done by a developer on Custom API Endpoint.
     
    Let me know if you have additional questions, but I think your solution should be simple enough with one or more custom API Endpoints.
     
    Regards,
    Saurav Dhyani
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 64,237 Super User on at
    Hiding columns from table in OData API calls
    Hi, hope the following helps.
    Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    If you are using a Web Service, you can hide this field on the published page so that users cannot see it.
     
    If it is a Flowfield or TableRelation field, it can be managed through permissions.
    More details:
    Dynamics 365 Business Central: What happens if users don’t have permission to read the table set in a FlowField?
    Dynamics 365 Business Central: What happens if users don’t have permission to read the table set in the TableRelation Property?
     
    Thanks.
    ZHU
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 7,399 Super User on at
    Hiding columns from table in OData API calls
    I would create a copy of that API and exclude the salary field in the newly created API. All employees would use the new API. 
     

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans