Skip to main content

Notifications

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.

  • Suggested answer
    Nsb Profile Picture
    5 on at
    RE: Cannot edit a record in Fixed asset book (AssetBook). The record has never been selected.

    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.

  • Nsb Profile Picture
    5 on at
    RE: Cannot edit a record in Fixed asset book (AssetBook). The record has never been selected.

    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.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Cannot edit a record in Fixed asset book (AssetBook). The record has never been selected.

    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?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,017 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,852 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans