Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Extend Item Entity API problem with itemattributes jsonarray

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

I am trying to extend the default "Item Entity" API Page in NAV BC. What I want is to add a jsonarray to a new property on the page called "ItemAttributes"

Problem is when I run this API in Postman the value of the property "ItemAttributes" is returned as a string and not as an jsonarray.

postman.png

al.png

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    ok got it working now.

    I had to make a new itemattribute part and attach that to "Item Entity" API Page and then som logic to calculate attributes OnAfterRecord

    working.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    Hello

    I dont think this is supported in extensions. At least not in target='Extension' in app.json

    I tried to subscribe to 'ApiSetup' in CU Graph Mgt - General Tools in order to inject a custom EDM type but I get this error

    The type or method 'InsertOrUpdateODataType' cannot be used for 'Extension' development
     
    edm.png
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    ok thanks. I will try this and get back to you

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    You’re right, missed the “.

    I think it’s because your itemAttributes field is a text field. You should do like the baseUnitOfMeasure field, so in the API Page a field with a tablerelation. Check how that field is managed.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    I dont think so.

    The problem is the trailing slashes \ and the quote

    A valid array would be

    {

    "itemAttributes": [{................. }]

    }

    but in my case I get

    {

    "itemAttributes": "[{.....................}]"

    }

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Extend Item Entity API problem with itemattributes jsonarray

    It seems correct to me, this is an array of objects:

    [

    {

    "Height":60,

    "Width":100,

    "Lenght":55

    }

    ]

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