Autodesk PLM 360
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Year in Computed Field for autonumber ing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Support Officer,
I am currently setting up a new workspace and I need to make use of the computed field for auto numbering. I need the last 2 digit of the year to appear in between my auto numbering. With the script below, I managed to get MPCR000001 but I really would like the number to be MPCRYY0001 instead. The YY represent the current year and changes whenever a new year arrived.For year 2013, the autonumber will look like this MPCR130001.
('MPCR' + dbo.PAD_ZERO(6, convert(varchar,REQUEST_NUMBER__AUTO_INC)))
Is there a way to do this? Really appreciate your help and advice.
Many thanks.
Carol
Solved! Go to Solution.
Re: Year in Computed Field for autonumber ing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Carol,
Given the limited nature of SQL scripting ( SQL scripting is for all intents and purposes limited for math calculations with in the computed field), this would not be the best way of doing it.
I would suggest using an “on creation script” using JAVASCRIPT (which is much more flexible).

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.
Re: Year in Computed Field for autonumber ing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Carol, Joe,
What you can do on the Field is to put that :
('MPCR' + dbo.PAD_ZERO(6, convert(varchar,ID__AUTO_INC)) + CAST(CONVERT (varchar, GETDATE(),101) as CHAR(10)))
And for sure you will be abel to play with the convert substring ... function available on SQL
Regards & hope this help

Jeremy PRINGAULT
EMEA Business Consultant
Autodesk
Re: Year in Computed Field for autonumber ing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Jeremy,
Good call, didn't think of it that way.

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.
Re: Year in Computed Field for autonumber ing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Jeremy,
Thank you for the solution, really appreciate it.
Best regards,
Carol Mak

