How to modify funding Source for particular Project contract In Ax 2012

How to modify funding Source for particular Project contract in Project Module. Below is the code sample to get Idea for the same.


 ProjFundingSource      projFundingSource;  
   ProjInvoiceTable      projInvoiceTable;  
   LogisticsLocation      logisticsLocation,logisticsLocationNew;  
   ;  
   ttsBegin;  
   while select projInvoiceTable  where (projInvoiceTable.ProjInvoiceProjId != "PROJ_002834")  
   {  
         while select forUpdate projFundingSource where projFundingSource.ContractId == projInvoiceTable.ProjInvoiceProjId  
         {  
           projFundingSource.FundingSourceId = projInvoiceTable.fundingSourceName();  
           projFundingSource.InvoiceLocation = 0;  
           projFundingSource.update();  
         }  
   }  
   ttsCommit;