Bhubaneswar, Odisha, India
+91-8328865778
support@logyscal.com

Auto Number in Dynamics 365 Plugin or Dataverse plugin

Auto Number in Dynamics 365 Plugin or Dataverse plugin

Dataverse already having a AutoNumber data type which we can use to generate auto number for our tables field. But if for some reason if you want to implement Auto Number generation for tables then you can write a plugin which will do the work for you.

It requires a configuration table to store current counter number and some dummy fields to add update lock.

Step: 1- Create a configuration table with be

Create a configuration table with 3 columns such as Current Number, Note and Rule all text data type.

Add a record with below data in the configuration table. Initially keep the current number as 0. as the counter will start from zero.

Step-2 : Add a text field in target entity

In the target entity lets say Revenue add a new field which will display the auto number.

Now write a plugin using below code. AS we have to use UPDATE LOCK to ensure uniqueness so update your code with your own tables. The plugin code is given below.

Now register the plugin in Post operation of target entity.

after that test the form. Create a revenue the revenue id will auto generate.

Also after this the configuration table gets updated with current value. The fundamental is the configuration table will store the latest counter for the target entity record and we read the value and add by one then update the counter.

Hope it helps.

You can enroll now !We are giving 30% discount on our Internship Program

Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024.  We will have most experienced trainers for you to successfully complete the internship with live project experience.

Why to choose Our Internship Program?

Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.

Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.

Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.

Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.

Free Demo Class Available