You are viewing limited content. For full access, please sign in.

Question

Question

Using delete in for each file activity

asked on February 27, 2017

Hello  ,

 

I have a case where i need to go through files in windows directory using for each file activity and including subfolders, then copy them to other location and then delete the initial file.

but when i use in SDK File.move (without File.copy) or File.delete (with File.copy) not all the files are inserted into laserfiche or copied to the other location.

when i user copy alone, the documents are copied normally. 

what should i do to the delete part ?

please advice .

0 0

Replies

replied on February 27, 2017

It's hard to guess without seeing your code. Are you getting any errors? Can you post the code?

0 0
replied on February 28, 2017 Show version history

Please see my code below after a snapshot of the workflow:

this is script 2

 

dim filelocation as String
        dim destination as string
        dim moveToLocation as string = GetTokenValue("MoveToLocation")
        filelocation = GetTokenValue("ForEachValue_Current Value")
        If(Not Directory.Exists(moveToLocation)) Then
                    Directory.CreateDirectory(moveToLocation)
         End If
        destination = moveToLocation & "\" &GetTokenValue("PatternMatching_subfolderpath")& "\" & GetTokenValue("PatternMatching_SubFoldes")
        '%(PatternMatching_subfolderpath)\%(PatternMatching_SubFoldes)
         If(Not Directory.Exists(destination)) Then
                    Directory.CreateDirectory(destination)
         End If
    destination = destination & "\" & GetTokenValue("ForEachFile_CurrentFile_Full Name")
        File.copy(filelocation,destination)
'        destination = "C:\Temp\okay"& "\" &GetTokenValue("PatternMatching_subfolderpath")& "\" & GetTokenValue("PatternMatching_SubFoldes")
'          If(Not Directory.Exists(destination)) Then
'                    Directory.CreateDirectory(destination)
'         End If
'
        'File.Move(filelocation,destination  & "\" & GetTokenValue("ForEachFile_CurrentFile_Full Name"))
    ' File.Delete(filelocation)

 

 

0 0
replied on March 2, 2017

hi miruna ,

did you see if there is an error in the code ?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.