Skip to main content

I have figured out how to upload an INfoPath attachment into a SP document library and then remove the file from the InfoPath attachment control. So I have a repeating group with 2 fields: 1 field for the file attachment and the other one for the URL.


The first problem I am having is how to verify if there is an attachment before using the code in K2 blackpoint to upload the document. I have tried different things like compare to empty string or null but the K2 process gives an error.


The second problem is if a user change for example the second file attachment then because the first file attachment is empty the K2 process will give an error. I need to allow users to change the attachments.


Also note that I need the InfoPath to be in a web browser. I have tried to integrate my InfoPath file with SmartObject but the infopath form doesn't open in the web browser with this technic.


Any help will be greatly appreciated.

For the first issue you can set a rule in the InfoPath form on the Attachment field to say that if the field changes (i.e the user attaches a document) then set a flag value in the form (i.e IsAttachment = Yes)  In the process you can then have the line rule that goes to the upload activity only evaluate to true if the flag value in the form is equal to yes.


For the second issue I am not quite sure I understand.  If you have a repeating node for Attachments how would the first item be empty?  Also what changes are the users making to the documents and why are they not making the changes to the document that has been uploaded to SharePoint?


For the third issue if you set the form to use Form Services in K2 Studio and when the form is deployed it still opens in the InfoPath Client application you should run the compatibility checker in InfoPath to ensure that your form is compatible with Form Services.  There are some controls that Form Services does not support.


I hope that helps.


Regards,


Eric


I have figure out how a way to put a flag when an attachment was added but I am not able to use this when it is with a repeating node because in BlackPoint there is no option to go through repeating nodes to save each INfoPath attachment. Unless there is a way that I could not find. I would like to use repeating node because it will allow users to add as much documents as they want. The only solution I have found right now, is a put for example 10 groups, one group per atatchment but they will always see 10 lines for the atatchments although some will be empty. And I am pretty sure at one point somebody will say that they need to be able to attach more than 10 files.


The reason for user not changing the document that was attached, is because they could have attached the wrong document to the item and they would like to change it with the proper document. I must specify the workflow is used for Doctor's tryout therfore there are many different kinds of forms which are attached to an item.


 Is there a web service that I can call within the Infopath form to upload attachments to a document library? This way I could create an InfoPath view to allow user to upload files and then submit the InfoPath form. I have found the K2 asmx files but I could not figure out how to use those in InfoPath.


 


I was able to figure out a way to loop through the repeating node to upload each atatchment to a  document library by using the Plan per slot option.


So I have set an activity Plan per slot based on the repeating group. Then I have added a SP document event top upload the attachment from XMLattachment. I use the option to save to a content the file that was uploaded. Then I grab the uploaded document URL and item and save it to 2 different fields in my Infopath form.


The problem I am having is that each node in my repeating group in my InfoPath form always have the same file URL and item name.


So how can I retrieve the URL and item of each document that were uploaded and save the document URL and title into the fields from my repeating group in InfoPath?


I have found out that the activity returns all the file links in one long string.


So I am thinking to use a reference event to extract each link and out each one in the appropriate node of the repeating node.


How can I accomplish that?


Reply