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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
FastTrack for Dynamics 365 forum
Unanswered

Updating purch Price in purch line table from trade agreement journal

(0) ShareShare
ReportReport
Posted on by 2
Trying to update the purch price in purch line table from trade agreement journal using batch job for bulk data update 
 
below is the code used to update 
 
   public void processUpdateprice()
    {
  
        PriceDiscStorageTable    priceDiscStorageTable;  // storing the current price value in this table from trade agreement journals 
        PriceDiscAdmTrans  priceDiscAdmTrans; 
        InventDim          inventDim;
        InventTable      invetnatble;
        PriceDiscTable     priceDiscTable;
        PurchTable        purchTable;
        PurchLine        purchLine;
        vendtable    vendtable;
        Amount     amount;
        try
        {
            ttsbegin;
           update_recordset purchTable
               setting
                PurchStatus = PurchStatus::Backorder    
                   && purchTable.IFSECProcess == NoYes::No
                        join purchLine 
               where purchLine.PurchId == purchTable.PurchId 
                    && purchLine.PurchPrice == 0
                        join priceDiscAdmTrans 
               where priceDiscAdmTrans.ItemRelation == purchLine.ItemId    
                            && priceDiscAdmTrans.AccountRelation == (purchTable.vendTable_OrderAccount().AccountNum);
            select * from priceDiscStorageTable where priceDiscStorageTable.ItemNumber ==  priceDiscAdmTrans.ItemRelation;
            purchLine.PurchPrice = priceDiscStorageTable.CurrentPrice;
            purchTable.IFSECProcess    = NoYes::Yes;
            purchLine.doUpdate();
            purchTable.doInsert();
            ttscommit;
        }
        catch (Exception::Error)
        {
            info(Exception error occurred);
        }
    }
 
priceDiscStorageTable by using this table trying to assign the current price value to purch price in purch line 

But Im  facing below issue 


I have pointed the Debugger but it is not showing any thing it is directly tiggering to catch exception.
*
Please help me to fix this issue 
Thanks in advance 
I have the same question (0)

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 June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > FastTrack for Dynamics 365

#1
André Arnaud de Calavon Profile Picture

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

#2
sannavajjala87 Profile Picture

sannavajjala87 2

#2
GA-18081426-0 Profile Picture

GA-18081426-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans