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 :
Microsoft Dynamics AX (Archived)

How i can insert new records over the same selection?

(0) ShareShare
ReportReport
Posted on by 578

I try insert new records over a record selection in the same table, but it shows an error " The record exist", I think this happens because the selection include the new record inserted.

    CostCenter cCenter, cCenter_upd;
    TransDate  CountDays;

    while select cCenter
    {
        CountDays = 01\01\2018;
        
        while (CountDays != 01\01\2019)
        {
            //info(date2str(CountDays,1,2,4,2,4,4));
            ttsBegin;
            cCenter_upd.clear();
            cCenter_upd.CostUnitId = cCenter.CostUnitId;
            cCenter_upd.ShiftTime = cCenter.ShiftTime;
            cCenter_upd.Speed = cCenter.Speed;
            cCenter_upd.doInsert();
            ttsCommit;
            CountDays ++;
        }

        cCenter.delete();
    }


How i can insert new records over the same selection?

it occurs to me to set them in a temporary table type variable, but I do not know how.

Can help me please, thanks in advance!

*This post is locked for comments

I have the same question (0)
  • ismaelivan Profile Picture
    578 on at

    Only RecId

  • Verified answer
    drodmarin Profile Picture
    380 on at

    Try Buf2Buf() method

  • ismaelivan Profile Picture
    578 on at

    Si, me sirvió así Buf2Buf(cCenter_copy, cCenter), muchas gracias David. Igualmente a ti Sukrut

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans