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 :
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > FastTrack for Dynamics 365

#1
MA-14071119-0 Profile Picture

MA-14071119-0 13

#2
Ajit Profile Picture

Ajit 2

#2
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans