Monday, September 24, 2018

How to update funding Source for Project Contract in Ax 2012

ProjFundingSource      projFundingSource;  
   ProjInvoiceTable      projInvoiceTable;  
   LogisticsLocation      logisticsLocation,logisticsLocationNew;  
   ;  
   ttsBegin;  
   while select projInvoiceTable order by ProjInvoiceProjId desc  
   {  
     if(projInvoiceTable.ProjInvoiceProjId != "S_002834")  
     {  
       if(projInvoiceTable.fundingSourceName() != "")  
       {  
         while select forUpdate projFundingSource where projFundingSource.ContractId == projInvoiceTable.ProjInvoiceProjId  
         {  
           projFundingSource.FundingSourceId = projInvoiceTable.fundingSourceName();  
           projFundingSource.InvoiceLocation = 0;  
           projFundingSource.update();  
         }  
       }  
     }  
     else  
       break;  
   }  
   ttsCommit;  

No comments:

Post a Comment