PW Document Code Configuration

I'm trying to configure a document code on my environment and I'm continually receiving this error message when I try to complete the fuction:

"Failed to update document code structure.  New code definitions cannot be saved because some required fields are empty."

I followed line-by-line what is written in the help file for "Defining Document Codes" and it seems logical.  Any thoughts as to what could be causing the issue or something for me to look at?  I have an attribute designated to hold the serial number, and I also have an attribute acting as a placeholder for the code.

  • It seems one of the elements of your document code is "required"

    no problem there is an option for optional or required for each element.

    But if you set required to a field and some where in the existing database for existing documents the field is question has never been used or is empty then you get an error like this. If this is really what you want you need to fill all the required fields before applying the document code settings..

    Also copying your environment to some test name and the testing the setting could help find the issue since there will be no documents attached.

    Best Regards,

    Ian Emery

  • That worked...I created a test environment (which has no documents under it) and I was able to generate a code as desired.  To apply to my live environment I will just empty out the collection of test files.  I noticed that the serial numer which is automatically generated is only 1 digit; do you know where to set it to three digits, so instald of "1" it would be "001"?

    Brent Mauti

    Architect, BIM Leader

    CH2M HILL

  • Set the format string on your attribute used for the sequence number. Go to the attribute properties, click the Editing tab, and in the format string enter %03d  and also probably a good idea to change the maximum input text length to 3.

  • That worked perfectly!  Now two more questions which I hope someone can answer.  Below is a screenshot of how I currently have the document code configured.  The desire is to have the code registered as DE-DEL-ADD-003, not to include the description.  I have a separate attribute where I used the following SQL statement to achieve that:  SELECT  SUBSTRING('$EDIT#DocumentTypeGROUP$',1,2) + '-' + SUBSTRING('$EDIT#DocumentTypeLEVELONE$',1,3)  + '-' + SUBSTRING('$EDIT#DocumentTypeLEVELTWO$',1,3).  BUT, attribute which stores my document code as the "Update Value" box under the "Value" tab grayed out stating "this field cannot be triggered because it is a code field.  Does anyone know where (if possible) I can enter this formatting to drive the concatenation of the code?

    Second question...my client would like to add Project Number as a prefix to the document code (so that serial numbers are numerated under a project number).  BUT, I have project number as a rick project property and not a document attribute.  Is there a way to add a project property to a document code?  OR, is it required...does the serial number work under a rich project, and thus if I have DE-DEL-ADD under different rich projects, will the serial number start back at 001?

     

    Brent Mauti

    Architect, BIM Leader

    CH2M HILL

  • A few things to understand about doc code document attributes.

    1. Doc code attributes must remain empty until a doc code is applied. If you plan to use the same (or truncated) value of another attribute (which must not be an attribute in the doc code definition), you need another attribute just for use in the doc code definition to store that data. I can't stress enough how important this is to understand. Also, if you set any rules on "Clear attribute value when" you should apply those rules uniformly to all doc code attributes so that you don't run into trouble later on.

    2. Doc code attributes' Default values are NOT populated when the document is created. They only apply in the doc code dialog when you want to apply a doc code to a document that doesn't already have one. The default value can be anything, just like any other attribute. If you are modifying an existing doc code on a document, then the values you see in the doc code dialog are those that are stored in the doc code attributes for that document.

    3. If you wish to provide the user with drop-down selections on doc code attribute(s), the Value list options can be set for each as needed, just as you can with any other attribute. If you don't want them to be able to select anything, don't put anything in the Value list section.

    4. Depending on settings applied to your doc code attributes (read only vs edit, using value list, limit to list, etc.), you might make it such that the user can change the values to whatever they want in the doc code dialog. Just be sure to test your settings to ensure it works as you intend.

    For the default value of the Document TypeGROUP attribute, set the SQL to get the truncated value from SomeOtherAttribute (change to whatever attribute you are going to depend on for the data).

    SELECT  SUBSTRING('$EDIT#SomeOtherAttribute$',1,2) 

    Do similar for the other 2 attributes.

    As for your question about using a Project attribute value in a doc code attribute, it should be possible. Set the Default value of the attribute to System Variable type, and then click the ... button to see a list of variables. Click on the Project properties tab to see available variables. If you are using Project properties (or even just truncating them via some SQL) this case wouln't necessitate having an extra attribute, though you could still set it up that way if you want to have the value in a non-doc code attribute as well.

    Serial number generation will be dependent upon what doc codes are already defined and reserved, and will generally go to the next available after the maximum used in conjunction with the other values.. Also, in the last screen of the doc code creation wizard dialog, pay close attention to the "exclude from unique id" option that will be available on for any attributes defined as doc code parts, as it will have an effect on not only serial number generation, but also what values are allowed. Note that you can enter your own serial number in the doc code dialog (individual selection only unfortunately) and if it doesn't violate uniqueness rules, it will be applied.