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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Cannot edit a record in The record shown has been updated by another user

(0) ShareShare
ReportReport
Posted on by 2,050

Greeting everyone 

I've created extension on from table PriceDiscAdmTrans

and add tow 3 fields also 2 method 

1-SnapshotPrice

2-SnapshotCost

3-SnapshotNewCost

and i want to update some fields (SnapshotPrice,SnapshotCost) because value come from extension method but i still getting error message

and here my extension code 

[ExtensionOf(tableStr(PriceDiscAdmTrans))]
final class PriceDiscAdmTrans_Extension
{


    public display real PreviousPrice()

    {
        PriceDiscAdmTrans   priceDiscAdmTrans;
        PriceDiscAdmTable   priceDiscAdmTable;

        select firstfast priceDiscAdmTrans order by RecId desc
            where priceDiscAdmTrans.ItemRelation==this.ItemRelation && priceDiscAdmTrans.relation==PriceType::PriceSales
            && priceDiscAdmTrans.AccountCode==this.AccountCode && priceDiscAdmTrans.AccountRelation==this.AccountRelation
            && priceDiscAdmTrans.ItemCode==this.ItemCode && priceDiscAdmTrans.InventDimId==this.InventDimId
            && priceDiscAdmTrans.FromDate==this.FromDate && priceDiscAdmTrans.ToDate==this.ToDate
        join priceDiscAdmTable where priceDiscAdmTable.JournalNum == priceDiscAdmTrans.JournalNum && priceDiscAdmTable.Posted==true;
        if(!this.SnapshotPrice || this.SnapshotPrice==0)
        {
            this.SnapshotPrice=priceDiscAdmTrans.Amount;
            this.doUpdate();
        }

        return priceDiscAdmTrans.Amount;

    }

    public display real PreviousCost()

    {
        InventTableModule   inventTableModule;
        select * from inventTableModule where inventTableModule.ItemId==this.ItemRelation && inventTableModule.ModuleType==ModuleInventPurchSales::Invent;
        if(!this.SnapshotCost || this.SnapshotCost==0)
        {
            this.SnapshotCost=inventTableModule.Price;
            this.doUpdate();
        }

        return inventTableModule.Price;

    }


}

and i getting on of those error sometimes when i open form

1-Cannot edit a record in Trade agreement journal lines (PriceDiscAdmTrans). The record shown has been updated by another user

2-Cannot edit a record in Trade agreement journal lines (PriceDiscAdmTrans). The record has never been selected.

I have the same question (0)
  • Nya Profile Picture
    29,060 on at

    Hi,

    Would you please specify which application you are using in Dynamics?

  • mohammed.mqi Profile Picture
    2,050 on at

    Dynamics 365 F&O

  • Suggested answer
    Nya Profile Picture
    29,060 on at

    Hi,

    It is recommended to post your issue to the forum of F&O for further help.

    Here is the link:

    (+) Dynamics 365 Finance - Forums, Blogs, Support

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans