3 Replies Latest reply on Nov 3, 2017 9:26 AM by Jan Stegmann

    Dispatch for set card variables

    Jan Stegmann

      I'm working on a dispatch to set part numbers on the part-card, using the filename without the extension. But I'm not able to create string for my variable, it's someone that can help me solve the problem.

        • Re: Dispatch for set card variables
          Stavros Smith

          I have one, load the attached file in dispatch.

          When loaded, it will appear as 'Name / Number Match'.  If the filename and serial number match already,  it will skip the operation.  You may want to check the target variable is the same as the one that you use.

          Kind regards,


          • Re: Dispatch for set card variables
            Paul Wyndham

            I did it similarly to what Stavros posted. I will try to explain in steps what to do in case you don't understand what is happening in the dispatch. Stavros variable steps are less than mine, but I wanted to make sure that I got the real extension if someone had an extra dot in their file name for some reason.


            Here is what I did.

            1. Add a new action to the dispatch admin Actions
            2. Enter the action information and select for a menu command.
            3. Create 5 variables:
              1. TotalLength -- Static String -- Length(%NameOfSelectedFile%)
              2. DotPosn -- Static String -- ReverseFind(%NameOfSelectedFile%,.)
              3. ExtLength -- Static String -- Sub(%TotalLength%,%DotPos%)
              4. NameLength -- Static String -- Sub(%TotalLength%,%ExtLength%)
              5. FileName -- Static String -- Left(%NameOfSelectedFile%,%NameLength%)
            4. Create the steps of the command and include one of the commands to set the card variable to FileName.



            I thought it was pretty clever that Stavros thought to check if the correct value already existed. That way if you select multiple file and the correct value is already there it does not check the file out and change it to the same thing.


            I don't think it is necessary to have a step to get latest version of the file since you are dealing with the file name and are writing to a card variable.


            If the variable for the file name is a version free variable you could get around the issues of having to check out and in. If the file happens to be checked out already the dispatch will give you an error. I can't see a reason you would need to know what the file was named at a specific version, but I guess there could be a reason if you want to tell someone that doesn't have vault access what the name was when you sent the file to them a year ago. It might be easier to just send it again.


            It would be nice if there was a dispatch option to do something on check in instead of just check out or when a file is added to the vault. In this situation you might have the file checked out when you decide to change the name. Then you would have to remember to right click and run the script.