Autonumbering with documents that have been revised

Autonumbering with documents that have been revised

Anonymous
Not applicable
1,119 Views
3 Replies
Message 1 of 4

Autonumbering with documents that have been revised

Anonymous
Not applicable

Hi there,

 

We created workspaces and used the autonumber feature, and we took some of these workspaces and reved them up with the managed state in a different workspace and workflow. When we did this, the working revision got assigend a new autonumber that was different from the active version. When we created a new document in the workspace, it automatically jumped numbers (because it used numbers for the working version). Is there a way to get the autonumber of the working version to match the active version?

 

Thanks for your help

0 Likes
Accepted solutions (2)
1,120 Views
3 Replies
Replies (3)
Message 2 of 4

dvirh
Autodesk
Autodesk
Accepted solution

There is no way to get the AutoNumber field to persist across different revisions and working of the same item. However, you can use a regular single-line-text field or even an integer field with the addition of some On-Create scripting behavior to achieve the effect you are looking for.

Hagay Dvir
Engineering Manager
Fusion Manage
Autodesk, Inc.
0 Likes
Message 3 of 4

broepke
Alumni
Alumni
Accepted solution

To add to what Hagay said - there is a prebuilt set of scripts we ship with the main tenant and a workspace that drives it.  It's super simple to reproduce it.

 

  • Go to the workspace "Sequencers" (in the Reference area of the main menu)
  • Create a new item.  Fill it out with the rules that you want to follow for the numbering.
  • Next you need to create a new action script.  Call it someting like "DocNumbering" or similar
  • In the "Imports" area of the script you need to add "sequenceOperator" to the script or this wont work...
  • Take the code below and paste it in.  

 

var itemSeqID = '332';

 

//set the new number

var newItemNumber = nextSeqNumber(itemSeqID);
item.NUMBER = newItemNumber;

 

  • Next you need to modify that code.  You need to edit the number (332) at the beginning to be the number that's listed in the "Seq ID" field on the item record you created in step 2.  You can see in my image below it's 2918... 
  • You also need to ensure that "item.NUMBER" called out above in the final line is in fact the name of your field. (NUMBER)

2014-03-14_19-05-28.png

 

  • Finally - Got to your workspace and the "Behaviors" section.  Here you need to add the "Create" behavior to be the script you just created.

 

Hopefully this isn't too simple of a description.  Most of the code needed for this is in the "import" (Library) script.  You're just simply calling the function in there and essentially pushing that value into the field.



Brian Roepke
Director, Analytics & Insights
0 Likes
Message 4 of 4

broepke
Alumni
Alumni

Michelle Stone blogged this with more detail:

 

http://underthehood-autodesk.typepad.com/blog/2014/03/feature-friday-scripting-secrets-in-plm-360.ht...

 

Enjoy



Brian Roepke
Director, Analytics & Insights
0 Likes