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.
- 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"
- 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.
- 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)
- 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".
- 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).
- Create an assign data task and use it to assign the value of the AutoNumber field to GV_AutoNumber
- 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)
- 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.
- 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.