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

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.

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    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)

  • Community Member Profile Picture
    on at

    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.

  • Manny Floyd Profile Picture
    50 on at

    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.  

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
Martin Dráb Profile Picture

Martin Dráb 51 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans