3 Replies Latest reply on Aug 8, 2011 8:02 AM by Tim Read

    Help with Action - can't check out or in...

    Brian Dalton

      I'm trying to create a Dispatch Action that will delete a specific file and replace it with a different file, but have the replacing file have the same name as the deleted one.  I ran this action originally without the Checkin and Checkout lines, but it didn't work.

       

      After some experimentation, I found that if I checked the file out manually, ran the action, then checked the file in manually, it worked.  Therefore I decided to try to have the check out and check in occur within the action, but it gives me an error, saying "the method completed successfully, but returned a value of 'false'.  I'm paraphrasing, but that's the gist of it.

       

      Does anyone know what this error means and how to fix it, or perhaps there's just a whole lot better way to create an action that will copy file A to file B, over-writing the contents, but retaining the file name.

       

      ThxBadAction.jpg

        • Re: Help with Action - can't check out or in...
          Faur Arama

          I think the problem is %PathToSelectedFile%, because you delete the file. Try to create a variable for the file name. Usually I had the same problem when the some how file name is incorrect.

          • Re: Help with Action - can't check out or in...
            Tim Read

            Hello Brian,

             

            I don't have an answer because I'm looking for the exact same functionality!!!

             

            I want to retain the history of the original part but replace the file. I am going to try a few things today and I'll get back to you and let you know if I succeed.

              • Re: Help with Action - can't check out or in...
                Tim Read

                Success!!!

                 

                I did not need to delete the original file - which I like! I just used a Shell Execute to copy the file.

                 

                copy "%PathToSelectedFile%" "%FileName%%Ext%" (variables are derived from rules on file naming)

                 

                I am copying the file I select over the top of another file, effectively replacing it's contents.

                 

                I found that copying the file "inside the vault" also worked but it threw an error that made it look like it did not work so I am going with the option of using a shell command.  I have not put in all the error checking, tests required but this is working for me (I have everything named correctly).

                 

                Hope this helps you,

                Tim

                Capture.PNG