Posted Mon, 29 Jan 2018 13:22:30 GMT by Jacek Musiał

Hello, 

I have one field in docuware where i would like to create auto increment. 
How can i do it ? 
I would like to make something like:
Prefix + number document 
CP01
CP02 
CP02 

I have connect docuware with outlook and i want create this increment only for "connect to outlook module"  

In attachment you can see what i want to do, can you help me ? 

Please

https://www.docuware.com/sites/default/files/forums-images/2.PNG

Posted Mon, 29 Jan 2018 15:24:30 GMT by Phil Robson DocuWare Corporation Senior Director Professional Services, Americas

Unfortunately, you can only set a numeric field to Auto Increment.

 

Phil Robson
Senior Director Support Americas

Posted Mon, 29 Jan 2018 17:59:29 GMT by Jacek Musiał

So you don't have any solve for this problem ? This numeration is really important for me and i have to do it...

Thank you for your help. 

Posted Mon, 29 Jan 2018 18:05:28 GMT by Jon Weston File IT Solutions Sr Application Developer and RIM specialist

What other modules do you have? If you have the Workflow Manager module you could do this quite easily (let me know if that's the case and I'll detail how).

Posted Mon, 29 Jan 2018 19:11:28 GMT by Jacek Musiał

Joh, yes i have a workflow manager. 
 

Posted Mon, 29 Jan 2018 19:52:18 GMT by Jon Weston File IT Solutions Sr Application Developer and RIM specialist

Cool, ok, let's give this a shot.  This will generate what you want for new documents stored using a dialog in Connect to Outlook only.  It won't work if you're sending it to a document tray from Outlook and then storing it afterwords because at that point we will have lost the fact that it came from Outlook.  I can't vouch for it being the best way of doing it - some others might have improvements or other suggestions - but it'll get it done.

  1. Add a text field called "DocSource" to the cabinet.  Make it invisible on all dialogs except the one you're using to store the document in Outlook - on that one set it to read-only but set it to a custom pre-defined entry of "Connect to Outlook"
  2. Add a numeric field called "AutoNumber" to the cabinet.  This will hold the incrementing autonumber.  Make it invisible on all dialogs except the one that you're using to store the document from Outlook - on that dialog set the Predefined Entry to "Automatic Numbering", click the + in the bottom left to add a numbering group and set your start value.  You could try making this field invisible on the dialog - I'm not sure if it needs to be visible to work.
  3. Add the text field to the cabinet that you want to store your final auto-numbered string with the prefix if you don't have it already.  From your screenshot it looks like you have this field called "Numer rejestracji" (Register Number)
  4. Ok, now for the workflow manager fun.  I'm assuming you have some knowledge of creating workflows and generally know your way around Workflow Manager.  Create a new workflow that is triggered on new documents that have a DocSource that is "Connect to Outlook".
  5. Add an integer variable called "AutoNumber" (we'll call that one GV_AutoNumber) and a text variable for the final output called "RegisterNumber" (we'll call that one GV_RegisterNumber).
  6. Create an assign data task and use it to assign the value of the AutoNumber field to GV_AutoNumber
  7. Ok, here's the magic bit.  Create another assign data task (don't use the same assign data task for both these operations).  Use it to set the value of GV_RegisterNumber to an Arithmetic Expression.  For the arithmetic expression use "CP" + CStr(GV_AutoNumber)
  8. Create another assign data task and use it to assign GV_RegisterNumber to the index data field that you want to hold your final output, Numer rejestracji.
  9. All done!

I know it's a bit weird having to do three Assign Data workflow steps in a row and you're thinking "why can't I just put them in one Assign Data step in the order that I want them executied?", but I've been told that if you combine all these operations in one Assign Data step DocuWare won't necessarily execute them in the order you think it will.

Also note that this will not zero-fill the numbers so you'll get CP1, CP2, CP3....CP10.  If you want them zero-filled then we'll add some stuff to step #7.

You must be signed in to post in this forum.