Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Re-use a previously deleted number sequence value

(1) ShareShare
ReportReport
Posted on by
Hello,
I have a scenario where I have added a custom field EDT XXXValue in the CustTransOpen table which is associated to a number sequence reference.
It should generate a new number sequence reference (e.g. 00001) whenever there are marked for transactions (i.e. records of SpecTrans).
However, if all marked records are unmarked (i.e. no spec trans association to the CustTransOpen) then the field value should be set to empty.
If the user wish to remark records, the value 00001 should be reused (if this value is not used in any CustTransOpen).
I have tried retrieving the value 00001 in the logic of spec trans delete and check if there are any CustTransOpen.XXXValue==00001.
If there are no existing records, then I am calling the logic NumberSeq::releaseNumber(numbersequenceID, 00001).
It is not working though.
Anyone knows how this could be done
  • Verified answer
    Jason0810M Profile Picture
    Jason0810M on at
    Re-use a previously deleted number sequence value
    Hello Andre,
    The business need is that a custom number sequence field needs to be added on CustTrans/VendTrans when doing settlement.
    All custTrans/vendtrans within same settlement logic needs to be filled with that number sequence (e.g. 0001).
    However, the field needs to be cleared if all the concerned settlements are cancelled.
    Therefore, the value 0001 is not being used anymore.
    If ever a new settlement is performed, the value 0001 should be available to be used again.
    I have managed to do it.
    I had set the numseq to Continuous and what was missing was setting the parameter _makeDecisionlater=true in the method NumberSeq::newGetNum when generating the number sequence.
    This fixed my issue.
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,684 Super User 2024 Season 2 on at
    Re-use a previously deleted number sequence value
    HI Jason,
     
    Can you tell what exact business requirement you try to solve with the new field and the number sequence? What is the added value for the organization? 
     
    Anyway, did you setup the number sequence itself to have the field Continuous enabled? 

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,414 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans