9 Replies Latest reply on Aug 28, 2014 6:00 AM by David Durston

    Enterprise templates - variable in template card

    Jason Capriotti

      You can specify a template card with card variables however can you default a field based on an Enterprise PDM Template variable? For example, I want to create several Enterprise PDM Templates for "Specifications" documents but use the same template data card for each. However, since we have different source documents for different "types" of specifications, I have to create an Enterprise PDM template for each since I can use variables in the source file path. Since I want to use the same template card and have only 1 for all types of specifications, can I pass a variable for the "Type" to the template card since the user has already selected the type of specification from the menu?

        • Re: Enterprise templates - variable in template card
          Michael Dekoning

          Yes. Use a variable for this with the type of "Format String" and set the desired value in each template.

            • Re: Enterprise templates - variable in template card
              Jason Capriotti

              I have but the template card will not pull it. I need to pull it when the template card loads to build the drawing number. The first 3 digits is a number code for a type of specification. The rest of the number is serial number generated. I can tell the template card to auto generate the serial number. But I can't figure out our to get the 3 digit number to populate using a template variable.

               

              I have 8 different specification types and they all have a different drawing formats and different 3 digit codes. The only way I can make this work is two create 8 different template cards with a default 3 digit number, I was trying to avoid so many cards and just have one for all specifications.

            • Re: Enterprise templates - variable in template card
              Michael Dekoning

              So in the dialog box where you set up the source file, did you copy your Template variable to the Card variable?

                • Re: Enterprise templates - variable in template card
                  Jason Capriotti

                  Isn't that for pushing a template variable to populate the file's data card variable?

                   

                  I guess what I want is to push a template variable to the template card, before the file card is even shown.

                    • Re: Enterprise templates - variable in template card
                      Michael Dekoning

                      Sorry, I thought you could use the template variable for your specification type and concatenate it with the serial number.  I stumbled on something that I think will work. The template variable that is type Serial Number (I named it Serial Number for the example) should be available from the list of values for a text string by clicking the ">" button. You can manually enter the type code in each template along with the "serial number" template variable.

                      variable.png

                        • Re: Enterprise templates - variable in template card
                          Jason Capriotti

                          Yeah, I have it defined like that now how it won't populate the template card. No I could pass that straight to the files data card....however I need the template card because it asks the user "Do you have a drawing number?"

                           

                          1. If yes, they type the number that was given to them......ok, no problem.
                          2. If no, then it should use the prefix 3 digit code followed by the serial number (no user input)
                          3. Either way the system names the file for the user based on the drawing number generated per 1 or 2 above.

                           

                          The template card won't populate from the template variable.

                            • Re: Enterprise templates - variable in template card
                              Rob D

                              If I am understanding this correctly, the template variables have a scope of that template. So while you run that template, they are active. Once the template is "complete", they're, for all intents and purposes, gone. Think of it, if you will, as a C++ for loop: for(int k=0;k<=5;k++)

                               

                              The variable "k" has a scope of only that for loop. The template variables are the same, they don't work beyond running that template.

                               

                              So, what you have is a template card which pulls in an input. Let's name it A for now. Variable A is pulled from the template card. It is then mapped to a template variable t_A in the scope of the template. It is then mapped to variable A on the data card using the template. The middle man is so that t_A can be used in file names, metadata, etc.

                               

                              The template card =\= the data card, and all data passed into the template card has to have the template variable middle man between it and the data card (if I understand them correctly, but from testing that's what I've seen)

                               

                              I think what you're running into is the order of operations cannot work in the way you say you need them to? You may need to dig into the API to get this one to work out.

                              • Re: Enterprise templates - variable in template card
                                David Durston

                                Jason,

                                Could you not have an additional drop down on the template card that is populated from an alias list?

                                So if the user does not have a part number they pick the specification type (by name) from the drop down and the 3 digit code is then supplied to your template variable.

                                 

                                Would this give you the result you are looking for? There is some but minimal user interaction.

                                 

                                David