Skip to main content

Hi,


Can anyone help me, here is what I want to do: User enters the information in an aspx page, the information entered is in turn submitted into a sharepoint custom list, this means it creates a list item in sharepoint and whatever document is added through the form is attached to the newly creater list item. Can we do this with Blackpearl?


Best Regards
Aseem Saxena

Hi Aseem


Im not sure whether this is exactly what you want but you can do the following:


1. Use SharePoint Document event wizard to upload your document to SPS doc library and store the URL to that document (you can do it by selecting 'Add this document to Content field' checkbox)


2. In your custom list create a hyperlink field eg. docUrl and populate it with the URL to the document which you've uploaded into the document library in step 1.


There might be a better way of doing it but this is something in the mean time :)


Lena


Hi Lena,


Thank you for the reply, actually what I want to do is, you have an option in custom list in MOSS where you can attach a document with the list item. Previously when I was using sharepoint designer I was able to initiate the workflow from list itself, hence what ever was attached remained with the list item. But now we are creating Aspx pages the user wants that the attachment uploaded in the aspx page should get attached to the newly created list item through k2 workflow. In MOSS if you click on a list item the attachment can be opened from there itself.


Regards
Aseem


Hello,


I would have a question from you Lena.


My process goes like filling an InfoPath form, then by submitting we start an approver process. begins.


If everyone says yes, then I insert the data from the InfoPath form into a list.


Would it be possible to attach the original filled InfoPath form to that list item?


Thanks,


Peter


Hi Petro.
If you are ready to write some code, this shouldn't be hard to achieve.


The InfoPath form is stored in the process context as an xml document.
I suggest dropping a server event in your process and write the code to do the stuff.
To attach a file to listitem, you should use the SPListItem.Attachments.Add method.


I hope this helps.


I've done this before without code but it was a bit convoluted and I don't have it in front of me.  I think it took about 5 different events to achieve this (within a single activity) and exposing the list as a SmartObject which exposes an add attachment method. 


However, in the end I found it worked just as well to create a different form library, upload the infoPath form into that form library and simply add a hyperlink field to the list and using the Documents event I set the metadata and link to the uploaded infopath form.


 


Reply