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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Job class to update" item model group "in inventModelGroupItem Table i'm facing issues !

(0) ShareShare
ReportReport
Posted on by 226
Hi every one!I have a requirement to change itemmodelgroup of item from /inventModelGroupItem/ table. Ihave to select UPDATE model group only where item type is /Item/ for all items. Item type is coming from Invent Table so Ihave to join the tables and then select /inventModelGroupItem/ for update.when i run thi class i face the error /Cannot edit a record in Relationship between items and item model groups (InventModelGroupItem). The record has never been selected/.  I have added the following code :
 InventModelGroupItem  inventModelGroupItem;        EcoResProduct         ecoresproduct;        InventTable           inventTable;        ttsBegin;                 while select forUpdate inventModelGroupItem            where inventModelGroupItem.ItemId != ''            join inventTable            where inventModelGroupItem.ItemId         == inventTable.ItemId            &&    inventModelGroupItem.ItemDataAreaId == 'QTS'            &&    inventTable.ItemType   == ItemType::Item        inventModelGroupItem.ModelGroupId = 'WA';        inventModelGroupItem.update();            ttsCommit;        info(/completed/);
 
 
  • Verified answer
    Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
    Hi,
     
    make sure you pointed to the legal entity QAS
    otherwise you can use changeCompany('USMF')
    try this :
            while select forUpdate inventModelGroupItem            
                where inventModelGroupItem.ItemId != ''            
                join inventTable            
                where inventModelGroupItem.ItemId         == inventTable.ItemId            
                &&    inventModelGroupItem.ItemDataAreaId == inventTable.DataAreaId
                &&    inventTable.ItemType   == ItemType::Item 
            {
    
            }
    Best regards,
    Mohamed Amine MAHMOUDI

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 528 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 424 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 374

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans