Skip to main content
Hi all

I've managed to get my infopath process uploading any number of attachments from within the form to a document library using the Multiple Documents event. However, I get an error if i submit a form that has no attachments in it - "Invalid Attached File". How do I go about allowing multiple documents to be uploaded if they're there but to not complain if there are none?

Thanks for any help you can give me!
P
Hi,
You can simply add an if statemnt which would not include the attachment object when the appropriate variable is null.
I am trying to develop a similar solution in which files attached to the InfoPath form are sent to a document library on Submit. Could you send me some pointers on how you accomplished yours?
Hi. Sorry for the delay in replying! Hope I'm not too late in being any help!

Having set the attachment field as a repeating field and having it in a repeating table in the infopath form, within K2 I used the Sharepoint 2003 Multiple Documents event. In the wizard I selected that document would be loaded from "XML Document containg attachments". The attachment XPath was set to the attachment field within the infopath form. The rest should be pretty self explanetory.

To stop an error if no attachment is selected, I edited the code and added


If SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value,"my:myFields/my:group1/my:group2/my:FileName") <> "" Then


before the attachment was accessed.

Hope this is helpful and that I've not gone into too much/little detail!

P

Reply