Fixed Asset Import

Hi,

f(assettable.AssetId == assetId)
        {

            select forUpdate assettable where  assettable.AssetId    == assetid
                  && assettable.dataAreaId == "DAT";

            ttsBegin;
            assetTable.initValue();
            assettable.AssetId= assetid;
            assettable.AssetGroup=assetGroup;
            assettable.Name=Name;
            assettable.NameAlias=Namealias;
            assettable.AssetType=assettype;
            assettable.propertytype= assetPropertyType;
            assettable.quantity= quantity;
            assettable.UnitCost= unitcost;
            assettable.model= model;
            assettable.modelyear= modelyear;
            assettable.serialnum= serialnum;
            assettable.location= location;
            assettable.Techinfo1= techinfo1;
            assettable.update();
            ttsCommit;


            }
        else
            {
            assetTable.clear();
            select * from assettable
              where assettable.AssetId != assetId;
            assetTable.initValue();
            assettable.AssetId= assetid;
            assettable.AssetGroup=assetGroup;
            assettable.Name=Name;
            assettable.NameAlias=Namealias;
            assettable.AssetType=assettype;
            assettable.propertytype= assetPropertyType;
            assettable.quantity= quantity;
            assettable.unitcost= unitcost;
            assettable.model= model;
            assettable.modelyear= modelyear;
            assettable.serialnum= serialnum;
            assettable.location= location;
            assettable.Techinfo1= techinfo1;
            assetTable.insert();
            }



          select forUpdate assetbook
             where assetbook.AssetId  == assetId
                 && assetbook.BookId == bookid;


           if(!assetbook)
                 {


            ttsBegin;
            assetbook.BookId    =   bookid;
            assetBook.selectForUpdate(true);
            assetbook.AcquisitionDate = acquistindate;
            assetbook.AcquisitionPrice = acquistionprice;
            assetbook.usedfromdate= usedfromdate;
            assetbook.Depreciationstartdate   =deprectionstartdate;
            assetbook.lastdepreciationdate= lasttdepreciationdate;
            assetbook.ServiceLife      =( servicelife);
            assetbook.PostingProfile   = postingprofile;
            assetbook.lifetime = str2int(lifetime);
            assetbook.lifetimerest= lifetimerest;
            assetbook.DepreciationConvention= assetDepreciationConvention;
            assetbook.Depreciation     = noYes;
            assetBook.AssetId          = assetTable.AssetId;
            assetBook.insert();
            ttsCommit;
                }
            else
                {
            assetBook.clear();
            assetBook.initValue();
            assetbook.selectForUpdate(true);
            assetbook.BookId    =   bookid;
            assetbook.AcquisitionDate = acquistindate;
            assetbook.AcquisitionPrice = acquistionprice;
            assetbook.usedfromdate= usedfromdate;
            assetbook.Depreciationstartdate   =deprectionstartdate;
            assetbook.lastdepreciationdate= lasttdepreciationdate;
            assetbook.ServiceLife      =  (servicelife);
            assetbook.PostingProfile   = postingprofile;
            assetbook.lifetime=str2int( lifetime);
            assetbook.lifetimerest= lifetimerest;
            assetbook.DepreciationConvention= assetDepreciationConvention;
            assetbook.Depreciation     = noYes;
            assetBook.AssetId          = assetTable.AssetId;
            assetBook.update();
                 }

I have been trying to Import fixed assets from an excel sheet, but I am not successful yet.

I was able to import all fixed assets and values to the asset book but it is not getting updated in the asset book form when I click on a value model from the action pane for the particular asset id. But I am able to see the record in the asset book table, but not in that form.

Please advise.

Regards,