This content has been marked as final. Show 4 replies
How are you adding your attachments? Manually or through code?
I just tried the following script:
and I got the name of the file. In my case I added the attachments manually.
I added them through code. It is Description that was missing, not name. In the attachments window, there is name and description. Name is path on the objects. I thought Description in the window was name. It seems Description displays name if you don't set a description. By explicitly setting description in the code, it gets passed to the workflow. When rendered into the next form, it still appends a timestamp to the end of both name and description. In an initialize event in the form, I am looping through and clipping off the 28 characters that are appended. Name is not RW though and what is used to access them through code. I am using code to launch the attachments. I am looking at creating a cross reference table in the initialize as a work around.
The biggest issue left for me is the error when there is only one attachment in the map.
You could add a step at the beginning of the process to get the size of the list. If the size is 0 go one way which is to use a document variable. Otherwise just use the list and loop.
0 isn't a problem, 1 is. It isn't in the main workflow, but in a call to a Render. I added an input variable of type Map to the Render. In the Advanced tab of my Document Form, I pass the main workflow variable of type Map to the Render. I suppose I could create 2 variables in the Render, a Map and a single document. In the script step that moves the data from the List to the Map, if there is only 1, put it in the document variable instead. Then I would have to deal with it in the Render.
I just ran it again with 1 attachment and it worked. I haven't changed anything in the Render or Advanced tab of the variable, just adding in the description, I guess I won't complain unless it starts breaking again later.