Skip to main content

Notifications

Announcements

No record found.

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 

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans