Hi All,
I am trying to update the table AssetBook. and getting the following error message:
Cannot edit a record in Fixed asset book (AssetBook). The record has never been selected.
Here is a snippet of my code:
assest = strRTrim(strLTrim(conPeek(record,1))); //Column 1
Info(assest);
acquisitionDt = conPeek(record,2); //Column 2
depricationProfile = conPeek(record,3); //Column 3
isDepricate = conPeek(record,4); //Column 4
costCentre = conPeek(record,5); //Column 5
assetBookTbl.clear();
ttsbegin;
select forupdate assetBookTbl where assetBookTbl.AssetId == assest;
if(assetBookTbl)
{
assetBookTbl.AcquisitionDate = str2Date(acquisitionDt,123);
assetBookTbl.DepreciationProfile = depricationProfile;
if(isDepricate == "Yes")
assetBookTbl.Depreciation = NoYes::Yes;
else
assetBookTbl.Depreciation = NoYes::No;
assetBookTbl.update();
}
ttscommit;
I am reading data from a .csv file and updating the table. I used infolog to check and data is being read correctly.
Plz help me understand my mistake in code.
Thank you.