Community

Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.

Notifications
Clear all

[Solved] Auto Numbering Question

0
Topic starter

Hello,

I'm trying to setup an Auto Numbering Rule for one property that is shared on multiple classes.  I would like the numbering sequence to be different between the classes and also have either AXXXX, BXXXX or CXXXX depending on the class.  Class A would have AXXXX, Class B would be BXXXX and so forth.  

Right now I'm struggling on how to even get the property to trigger but it could be a setup issue on my end. 

This is my current configuration.  I'm not sure if I need to use Simple or Custom Numbering type.

image

Thank you

Jeff

Topic Tags
3 Answers
0

Hi @jwittkopf

 

auto-numbering module triggers upon the creation of new objects.

Based on your requirement, I've implemented a custom numbering using regular expressions to ensure precise increments for numeric values. Here's how it works:

Regex Pattern used: (A)(0+)(\d+)

Explanation:

(A): This captures the letter "A" literally.
(0+): This captures one or more occurrences of the digit "0", ensuring any leading zeros are preserved.
(\d+): This captures one or more occurrences of any digit, representing the numeric part that we'll increment.

Whenever a new object is created, the auto-numbering module will use this regex pattern to identify and increment only the numeric part while preserving the leading zeros.

Configuration example:

image

 

 

Hope this helps!

 

Regards, 

Nikolina

0
Topic starter

This worked great Nikolina.  Thanks for the help.

 

Another question on this since this is getting generated on creation of object would there be a way to generate a different number if they changed the object type.  For example, we would have 4 different rules on the numbering depending on a value list that they choose which would have it create either A0001, P0001 or E0001.  If they accidentally picked the value list to create the numbering for A0001 but then went back to the object and changed the value list could it go back and change the autonumbering to P0001?

 

I think that might need to be in the orchestrator rule to trigger this but the little bit that I tried to get that to trigger it just errors out.

 

Thank you,

Jeff

0

Hi Jeff,

I'm glad to hear that the solution worked well for you!

Regarding your question about generating a different number if the object type is changed, unfortunately, once the object is created with a specific numbering, it cannot automatically change if the property is modified. The auto-numbering module is typically set up to execute only upon creation of the object.

To implement such functionality would require modifications, potentially involving triggers or workflows within the orchestrator rule, as you mentioned. However, at the moment, this isn't supported out-of-the-box and would likely require development. We'll certainly consider adding this option in future updates to enhance the functionality. 

As a potential workaround, one approach could be to allow users to destroy the incorrectly created object and then recreate it with the correct object type.

Best regards,
Nikolina

Answer