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)

Auto Numbering based on form id

(0) ShareShare
ReportReport
Posted on by 2,665

Hi,

I am using 'Case' entity which has two forms(form1 and form2). I want to generate auto numbers separately for both the forms. How can I get the form id when writing a plugin for auto number. Please suggest some ideas.

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    With JavaScript, you can use the Xrm.Page.ui.formSelector item to get the label or GUID of the form itself.

    See:

    msdn.microsoft.com/.../gg309560.aspx

    Having that information, you can set a hidden field on your record (also via JavaScript).

    In the plugin, you can then get the field off either the context entity or by retrieving the record and including that field in the ColumnSet.

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    You can't pick up the form id from a plugin, but I suggest that you create a field that that you set using a Business Rule to set the default that is only enabled for one form. This way when the record is saved, it will default to the value that was defined in the business rule for that form. So for form 1 you'd have a business rule that sets the value to 'Form 1' and for form 2 it would be 'Form 2' etc.

    You can then pick this value up in the numbering plugin.

    You could also do this with a Real Time Workflow - see this excellent example - http://crm.fueledbysleep.com/

    I 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