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

Notifications

Announcements

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

News and Announcements

Season of Giving Solutions is Here!

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 > FastTrack for Dynamics 365

#1
AD-16121015-0 Profile Picture

AD-16121015-0 6

#2
Anthony Blake Profile Picture

Anthony Blake 4 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans