Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / How to assign version ...
Finance forum
Suggested answer

How to assign version numbers to the existing records and also increment version number?

Posted on by 142
Hi,
My requirement is in quality order, based on item number and batch the version numbers to be inserted and also increment the version number, if new quality order is created for same item number and Batch number. How can we achieve this. 

For ex: If there is item : item001 with Batch : Bat001, With same item and Batch, if there are 3 existing Quality order: Q001, Q002 and Q003,
1)How can we insert version 0, version 1, version 2 respectively to the quality order and
2) in case a new quality order Q004 is created, then version number to be updated as Version 3.
Quality order idItem idBatchVersion no
Q001item001Bat0010
Q002item001Bat0011
Q003item001Bat0012
Q004item001Bat0013
 
  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,566 Moderator on at
    How to assign version numbers to the existing records and also increment version number?
    I could not get the correct understanding. Can you please give more detail on requirement?
  • Suggested answer
    Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    How to assign version numbers to the existing records and also increment version number?
    Hi,

    To assign version numbers to existing records and increment the version number, you can follow these steps:

    1. Create a new field in your Quality Order entity to store the version number. Let's call it "VersionNumber".

    2. In the Quality Order form, add a logic that retrieves the maximum version number for the same item number and batch combination. This can be done using X++ code or workflows.

    3. When creating a new quality order, set the "VersionNumber" field to the maximum version number retrieved in step 2 plus 1.

    4. Save the quality order with the assigned version number.

    Best regards,
    Kevin

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans