📚 SAP Business One SDK Help

AssetRevaluation Object
See Also  Members  Example

Description

Use the object to revaluate assets. 

Source table: OFAR.

Object Model


Remarks

Financials --> Fixed Assets --> Asset Revaluation

Example

C#Copy Code
SAPbobsCOM.AssetRevaluationService revalService = (SAPbobsCOM.AssetRevaluationService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.AssetRevaluationService); 
            SAPbobsCOM.AssetRevaluation revaluationObj = revalService.GetDataInterface(AssetRevaluationServiceDataInterfaces.arsAssetRevaluation); 
            SAPbobsCOM.AssetRevaluationParams revaluationParams = revalService.GetDataInterface(AssetRevaluationServiceDataInterfaces.arsAssetRevaluationParams); 
            revaluationObj.PostingDate = new System.DateTime(2022, 12, 31, 0, 0, 0); 
            revaluationObj.AssetValueDate = revaluationObj.PostingDate; 
            revaluationObj.DocumentDate = revaluationObj.PostingDate; 
            revaluationObj.SummerizeByProjects = BoYesNoEnum.tYES; 
            revaluationObj.SummerizeByDistributionRules = BoYesNoEnum.tYES; 
            AssetRevaluationLineCollection lines = revaluationObj.AssetRevaluationLineCollection; 
            AssetRevaluationLine line = lines.Add(); 
            line.AssetNumber = ""A003""; 
            line.NewNBV = 76800; 
            line.RevaluationPercent = 110; 
           revaluationParams = revalService.Add(revaluationObj); 
            if (revaluationParams.DocEntry != 0) 
            { 
                MessageBox.Show(""created!""); 
                company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit); 
            } 
            else 
            { 
                MessageBox.Show(company.GetLastErrorDescription());                //oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack); 
            }

See Also