Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Copy Field Value to Next Record

(0) ShareShare
ReportReport
Posted on by 50

Hello d365 Community, 

I have a value that I want to copy it to the next record. It's basically a number that will be incremented by 1. 

For example, user will enter 2001 in Ticket # field, save and close. The next record value in Ticket # will be 2002 ( pre-populated).  This number can start with 4 digit or 5, it's not fixed, otherwise I would have used Auto-numbering.

  • Manny Floyd Profile Picture
    50 on at
    RE: Copy Field Value to Next Record

    Hello Wahaj,

    I am using Celedon Auto Number Plugin. It works fine for the first record. However, when I try to create 2nd record for the same entity and same field, it's giving me a "Duplicate AutoNumber record exists" error.  

  • Community Member Profile Picture
    on at
    RE: Copy Field Value to Next Record

    Hi Emanuel,

    You can use flow to achieve it, which don’t need any code.

    1.set ‘when a record is created’ as trigger.

    pastedimage1608519544004v1.png

    2.Add ‘List records’ action to list one most recent record(not just created) to get ticket.

     pastedimage1608529843139v4.png

    3.Add ‘condition’ to check the ticket field is null or not.

     pastedimage1608520083398v3.png

    4.If the ticket field of the latest record has value, add 1 and update the new record with it.

    In 'Yes' Branch, add 'compose' action and 'Update a record' action.

    pastedimage1608531789591v6.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Copy Field Value to Next Record

    Hi,

    Thank you for your query.

    One Idea is to use Autonumber but update its seed using API. That means, once user enters the value, use API (via flow or plugin) to update the seed.

    You can update seed as per below instructions:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes#set-a-seed-value

    If above solution is not ideal for you, you have to implement this logic using a Plugin.

    Here is the high level plugin logic:

    • Plugin triggers on pre Create of the record.
    • Get the latest record and the number entered by user.
    • Increment the number and assign it to the current record.

    Let me know if you need more clarification.

    Best.

    Wahaj

    (if it helps, mark it as verified)

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans