4 Replies Latest reply on Jun 17, 2011 4:21 PM by Louis Moskven

    Access Enterprise PDM serial numbers in code

    Louis Moskven

      Hello,

       

      I'm attempting to build an addin in C#  (for EPDM 2011) which copies and pastes references into a DCN (Document Change Notice) in an automated manner, but I'm running into a problem referencing the document in my code; I was hoping to be able to match up the serial number assigned to the document from the serial number generator in the Admin tool to my code, but so far I've only managed to produce another serial number generator which parallels the numbering scheme assigned to the document; I'm wondering if any anyone has any hints as to how to specify a serial number generated in EPDM admin tool to Add-in Code?

        • Re: Access Enterprise PDM serial numbers in code
          Corey Vantilborg

          Louis,

           

             The serial number generator itself does not  track where the serial numbers it issues are used.

           

             What mechanism are you using to assign the serial number to the DCN?

           

             I suspect it ends being being a variable of the DCN document.  If that is the case then you need to use the variable APIs to read the value of the variable assigned by the the serial number generator.

           

              I would start at this Method to start getting the variables :  IEdmFile5::GetEnumeratorVariable.

           

          Corey V

            • Re: Access Enterprise PDM serial numbers in code
              Louis Moskven

              To assign serial numbers to documents, i'm just linking a predefined, numerical serial number to the data card variable of new document as its produced (from a template);  I'm new to API programming so (lets see if I understand), by calling the method you have suggested, I can specify a variable which takes on the value generated by the serial number?

               

              Louis M

                • Re: Access Enterprise PDM serial numbers in code
                  Corey Vantilborg

                  Louis,

                   

                     You are using the Vault template function to assign the serial number to a document?  The method I mentioned will let you programatically access the datacard variables of a particular file.

                   

                     If you want to generate a new serial number and assign it, you would have to do something a little different.  In that case I would:

                   

                  1. Use IEdmSerNoGen7::AllocSerNoValue to get a new serial number from the generator
                  2. Use IEdmSerNoValue.Value to read that new serial number
                  3. Use IEdmFile5::GetEnumeratorVariable to ge the Variable Enumerator for the file you want to assign the serial number to
                  4. Use IEdmEnumeratorVariable5::SetVar to assign the serial number from step 2.

                   

                      Not that I am missing steps in this, that is a rough overview. Also I have not done exactly what I listed above so I don't know that is the best way, or even a good way to do it.  Hopefully it points you in the right direction though.

                   

                  Corey V