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

How to fix "The operation cannot be completed, since the record was not selected for update. Remember TTSBEGIN/TTSCOMMIT as well as the FORUPDATE clause."

(0) ShareShare
ReportReport
Posted on by 272

Here my scenario:

1st: Form A -> Click button -> Creates a new record and update the args.record() from Form A -> done (it is working here)
2nd: Form A -> Click button -> Form B -> Creates a new record and update the record from Form A using the record in Form B (record in Form A and Form B has connection) -> not working here

it uses the same class, there's just one more step on the 2nd scenario but it basically performs the same methods.

I searched everywhere for the fix for this, but I still get the error.

My code is below:

ttsBegin;
    
_wharfageSalesLine.selectForUpdate(true);
_wharfageSalesLine.RecordReference = 1;
    
if (!isLineDetailsAvailable)
{
    _wharfageSalesLine.FullyCredited   = NoYes::Yes;
}
    
_wharfageSalesLine.doUpdate();
        
ttscommit;

I performed debugging, the record Id is not blank. The record is recognized. But still it tells me that the record was not selected. 

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    add _wharfageSalesLine.reread(); after _wharfageSalesLine.selectForUpdate(true);

  • WillWU Profile Picture
    22,361 on at

    Hi Miguel,

    Where is buffer for _wharfageSalesLine?

    It seems that you haven't selected any record, the selectForUpdate(true) method is used to set a property on the buffer, so that next time a select is performed the record is locked

    You have to add select statements after ttsbegin.

    docs.microsoft.com/.../xpp-data-query

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Good morning Miguel,

    Just wanted to follow up on this one and ask if you have been able to get the issue fixed based on the feedback provided.

    Can you also let us know whether this issue is related to D365FO or AX2012?

    Would be great if you could provide us with an update.

    Many thanks and best regards,

    Ludwig

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 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans