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, ...
Unanswered

How to Activate Item Price x++

(0) ShareShare
ReportReport
Posted on by 117

Hi all, 

       I am writing a piece of code on update button on a form where the end user can change the current price of an item by clicking on update button on Action Pane. I have written the code which can activate the updated price but the problem is every item has two sites namely USA and DRP and I want to activate it for both sites. 

On my main datasource of the form, I have a field named Site which is an enum field with two elements USA and DRP.  How can I iterate through these two elements and create two records on Item Cost form with these two sites but with updated cost. Thanks

Tell me what do you want more from me in order to understand this more. Do you need my written code ?

I have the same question (0)
  • 00030000036294D5 Profile Picture
    117 on at

                  select * from kwd_ItemCostUpdateTable;
    
                   while(kwd_ItemCostUpdateTable)
                {
                    ttsBegin;
                    itemSimTable.clear();
                        itemSimTable.ItemId = kwd_ItemCostUpdateTable.ItemId;
                        itemSimTable.Price = codeChargesTable.UpdatedPrice;
                        itemSimTable.VersionId = 'STD';
                        itemSimTable.PriceType = CostingVersionPriceType::Cost;
                        itemSimTable.PriceAllocateMarkup = NoYes::Yes;
                        itemSimTable.FromDate = today();
                        itemSimTable.Markup   =  calcCharges.getChargesValue(kwd_ItemCostUpdateTable.ItemId,  enum2str(kwd_ItemCostUpdateTable.Site));
                        itemSimTable.PriceUnit  = 1.0;
                        itemSimTable.UnitID     = 'ea';
    
    
                        inventdim.InventSiteId =    inventDim.InventSiteId;
    
                        inventDim = InventDim::findOrCreate(inventDim);
                        itemSimTable.InventDimId = inventDim.inventdimid;
                        itemSimTable.insert();
                     ttsCommit;
                }
                        inventItemPriceActivationJob = InventItemPriceActivationJob::construct();
                       inventItemPriceActivationJob.activateOneInventItemPriceSim(itemSimTable);

    This is the code I am using to activate new item price. The new records first gets inserted into InventItemPriceSim table and once we activate it with the help of InventItemPriceActivationJob class, it gets into InventItemPrice table. 

    I have tried to debug it. Here is my finding, The debugger loops through the code twice, but every time, it iterates through the same inventdimid which I do not know why. There are two Dim IDs in InventItemPrice table of the item, but it loops through the same one id both times. 

    please help !!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 662 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#3
Subra Profile Picture

Subra 489

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans