web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Cannot edit a record in Fixed asset book (AssetBook). The record has never been selected.

(0) ShareShare
ReportReport
Posted on by 5

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.

  • Gunjan Bhattachayya Profile Picture
    35,429 on at

    Hi Nsb,

    I don't see anything wrong in the code you have given here. Is there any existing customization to AssetBook\update method that might be causing the issue? Have you debugged update method to check which line of code is causing the issue?

  • Nsb Profile Picture
    5 on at

    Hi Gunjan,

    Thank you for the response. There has been no customization on the table or its methods. I will use a debugger on the update method and check.

    Thank you.

  • Suggested answer
    Nsb Profile Picture
    5 on at

    The issue got resolved.

    There was issue with converting str to date.

    I replaced assetBookTbl.AcquisitionDate = str2Date(acquisitionDt,123);

    with assetBookTbl.AcquisitionDate = any2Date(acquisitionDt);

    This worked for me.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 543 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 415 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans