Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to set Serial Number in Multiple Lines of any Header?

Posted on by Microsoft Employee

I have Sale Slip Header(Custom Entity) where user can print Sale Slip(Word Template) and Sale Slip Header consist multiple Sale slip Lines but the requirement is that every Sale Slip Line must have Serial Number. For Example I have purchased 3 items and all 3 items details present in Sale Slip Line, Now each item serial number(1,2 or 3) should be generated so that Multiple sale slip line Item can identify in Printed Sale Slip. 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to set Serial Number in Multiple Lines of any Header?

    Nice I try to implement this logic . Thank You Shidin :)

  • Verified answer
    Shidin Haridas Profile Picture
    Shidin Haridas 3,497 on at
    RE: How to set Serial Number in Multiple Lines of any Header?

    Sorry, let me be more clear, you can have a pre-plugin on create of Sale Slip line item.

    The plugin does the following:

    1. Checks if the Sale Slip item has a Sale Slip Header value.

    2. Retrieve the 'Serial Number' latest created Sale Slip item that is associated to the Sale Slip Header retrieved in step 1.

    3. Add +1 to this number and pass this number into the 'Serial Number' of the Sale Slip line item getting created.

    If no records were retrieved in step 2, set serial number to '1'. (initial number)

    The pros of this solution is:

    1. Simple plugin to get serial numbers in order.

    2. Do not have to store the number anywhere as we are relying on the last created Slip line item +1 to give the next number.

    Cons:

    1. Users must not be allowed to manually edit this serial number.

    2. Does not cover scenarios where you update the Sale Slip header on a Sale slip line item. (This might not even be possible in your system)

    Please let me know if you need more details.

    Cheers!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to set Serial Number in Multiple Lines of any Header?

    Yes Auto Numbering can be implemented easily but Auto numbering sequence does not start again with Initial number . it always increment by 1.

  • Suggested answer
    Shidin Haridas Profile Picture
    Shidin Haridas 3,497 on at
    RE: How to set Serial Number in Multiple Lines of any Header?

    A bit confused here as the title and the question seems different and you mentioned Word Template as well,

    Either way, why don't you try implementing a simple auto-number for your Sale Slip line item?

    Let me know if you need more details on the auto-numbering.

    PS: Also mention your CRM version.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans