web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to find If a specific item has attribute value of Item Type or not using InventSum as master table

(0) ShareShare
ReportReport
Posted on by

I am using InventSum and InventDim as the master tables in my DP class to get all the other field values, now I have to find that if a specific item has any attribute value or not, if item has attribute then it should show the value of the item. I have done this earlier in SQL but I am finding difficulty in joining my query with the master tables.

SQL query is as follows:

select TEXTVALUE,* from ecoResProductAttributeValue
join  ecoResAttribute
on ecoResAttribute.RecId = ecoResProductAttributeValue.Attribute
join ecoResValue
on ecoResValue.RecId = ecoResProductAttributeValue.Value
where ecoResProductAttributeValue.Product = 68719556622
AND ecoResAttribute.Name = 'Item Type'

My code in DP class is as follows:

while select * from InventSum
                join inventDim
                where InventSum.InventDimId == inventDim.inventDimId
                join inventLocation
                where InventLocation.InventLocationId == inventDim.inventlocationid
                && (InventLocation.inventlocationId == ShopId || InventLocation.inventlocationId == 'All')
{
//all field values that i want to get are set here
}

I want this kind of result but against a specific item,

pastedimage1601416218387v3.png

So product 68719556622 has atttribute attached with it of name item type and value A, I want to get same thing but with itemId and using the master table inventSum and InventDim in my DP class.

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sadia,

    Could you please share the SQL query? The screenshot is too small.

  • Community Member Profile Picture
    on at

    Hi Gunjan Bhattacharyya,

    I have shared the code of SQL query in the post please look again

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Sadia,

    You posted two complete different queries. The SQL query is about attributes The x++ logic is using the InventSum table which is used for on-hand information. Or do you need help how to translate the SQL part on line 8?

  • Community Member Profile Picture
    on at

    André Arnaud de Calavon, I shared the scenerio, I wanted to get the attribute value against item id, I am taking item id from inventsum as shown in the x++ query, as far as the sql query is concerned, it retrieves the value of the attribute . So, my main concern is to connect that sql query with the X++ query having inventsum table by using any relation between tables but I am unable to find the direct relation.

  • Verified answer
    Community Member Profile Picture
    on at

    Issue is resolved now, I have created a view and used it to get the result

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Thanks for your feedback, Sadia. I have verified your answer to set the status of the question to 'Answered'.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans