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

Notifications

Announcements

No record found.

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.

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans