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 CRM (Archived)

Reference Number for Child Record?

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm looking to create a reference number for child records, but the numbers start back at 1 for each parent record.

For example, we have 2 parent records - 'Parent Record A' and 'Parent Record B' and they both have 2 child records. The reference number for the child records would then be:

"Child Record from Parent A - 1"

"Child Record from Parent A - 2"

"Child Record from Parent B - 1"

"Child Record from Parent B - 2"

Does anyone have any suggestions for how I would get this to work? My first thought would be to write some Javascript that would loop through the children record and increment a field by 1 - does anyone know if this has been done before?

Thanks! Katie  

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Katie110596,

    You could create a Plugin that runs whenever a child record is created or updated and assigns a reference number to each child record in order of created on date. However, this will only work well if the child records can only have one parent.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    As you need to have the sequence number per record, you need to store the number on the parent record itself and default it to 0. And now you can create a real time workflow on your child entity create which first increment the sequence number by 1 and then sets that number on your child record.

    You can refer this blog for the concept. The difference is that in our case we are storing the sequence number on the same entity record ( and not a separate entity)

    community.dynamics.com/.../auto-numbering-through-real-time-workflows-no-customization-no-add-on

    I have done something similar so if you need any further assistance, let me know. Below are some screenshot which can help you. Item Code is the parent and Proposal is child entity. With the workflow, I am populating incremented name for the child entity i.e. proposal

    seq02.png

    seq02.png

    seq03.png

    Hope this helps.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans