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, ...
Unanswered

update conflict on record

(0) ShareShare
ReportReport
Posted on by 468
I have got 2 custom tables with same key fields and almost same fields. 
 
When the data gets updated in one table the other table has to be updated with the same data and vice versa.
 
When I make any updates on one form, I randomly get the below error message

Cannot edit a record in xxx (xxxTable). An update conflict occured due to another user process deleting the record or changing one or fields in the record.

I am the only user in my dev environment and no other user is currently changing anything 
 
So, on the form datasource write() method I have written code to update the data 
table 1

public void write()
{
     GeneralTable     generalTableFind, generalTableUpdate;
    
    super();
	
    element.numberSeqFormHandler().formMethodDataSourceWrite();       
    
    ttsbegin;

    update_recordset BatchAttributesTable
                setting
                 Group             =  GeneralTable.Group,
                FromDate           =  GeneralTable.FromDate,
                ToDate             =  GeneralTable.ToDate,
                AlloyNum           =  GeneralTable.AlloyNum,
                Metric             =  GeneralTable.Metric,
                MARS               =  GeneralTable.MARS,                
        where BatchAttributesTable.GeneralId    ==  GeneralTable.GeneralId;

    ttscommit;
}
For the second table I have written code on the update method
 
public void update()
{
     GeneralTable             this_Orig = this.orig();
     GeneralAndTable          GeneralAndTable;
     BatchAttributesTable     BatchAttributesTable;
    
    ttsbegin;

    super();

    if(this_Orig.GeneralId != this.GeneralId || this_Orig.Version != this.Version)
    {
        
        while select forupdate GeneralTable
            where GeneralAndTable.General Id == this_Orig.GeneralId
               && GeneralAndTable.Version == this_Orig.Version
        {
            GeneralAndTable.GeneralId = this.GeneralId;
            GeneralAndTable.Version = this.Version;
            GeneralAndTable.update();
        }
        
    }

    ttscommit;
}
 
Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans