2012년 4월 25일 수요일 오후 5:23
The bottom line is I have an Infopath Form (IP) to submit change requests. I am not versed in the "usual" methods of decoding attachments from XML (I see all the threads and I am lost) so I added a hyperlink in the form that opens a separate MOSS library where they upload documents that relate to the change request. After a document is uploaded they are returned to the IP form to click "Submit". So the document is added to the separate document library before the IP form is submitted.
The MOSS library that holds the attachments has a default view (All Documents) that was modified to sort "Created" in decending order and the "limit" on the document library is set to return 1 document. When you look in that MOSS library, you see only the last item added. Great!
There is a data connection that is part of a rule on IP form submit that goes to the MOSS library of attachments and pulls in the title of the last document if certain "created by" conditions are met. The point here is that in the form library you have a reference to any attachment related to the change request.
When I preview this in IP, it works perfectly. When I publish the IP form to MOSS, the document title pulled by the data connection is the first (oldest) document in the library, not the newest one!
Why does it do this?
2012년 4월 25일 수요일 오후 6:31I found out that in browser enabled forms, the view sort order is totally ignored in the data connection BY DESIGN. I will repost as a question to retrieve the name/title of the most recent entry in a document library.
2012년 4월 25일 수요일 오후 6:41
I want to use a data connection in IP to retrieve the title or name of the last item of a MOSS document library. I have the data connections already, I have the library already. I have the browser enabled form already. In tests, I could get the last item using a sort and a "return limit" in the MOSS library. But that is when I learned that a browser enabled form that the library view sort order and any filtering is totally disregarded by IP and my data connection is pulling the FIRST item in the library, not the last.
I only workflows in SPD, sharepoint server, and basic no-code InfoPath. I hope there is a no-code or at least simple way to accomplish this. I appreciate any help to what should be a basic problem (but is not).
- 병합됨 Ian K - MSFTMicrosoft Employee 2012년 4월 25일 수요일 오후 7:17 Duplicate
2012년 4월 25일 수요일 오후 7:02
I'm not sure if this is the best solution but it will work.
Create a new Custom list as Config List.
Add column named LastItemId.
Whenever a new Infopath form is created update that column to ID of that form (using SPD Designer or other ways).
So now add data connection to get that LastItemId value and use it to filter the value of data connection use to get IP Lib values.
Dare to promise
2012년 4월 25일 수요일 오후 7:05
Hi Quized again,
When I set up a test like yours, it works great for me in the client, too. When I open it in the browser I get all the items in the library returning, with the oldest at the top of the list. I believe it sorts by ID, Ascending. This is how it defaults in 2010, at least.
You might be able to use the owssvr.dll to retrieve the Title of the latest item in the library. Try creating a data connection to an XML file:
This will force it to sort by Created Date descending. It would return all the items in the list, but the top one in the list is the newest.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Microsoft Online Community Support
- 답변으로 표시됨 Quized again 2012년 4월 25일 수요일 오후 10:12
2012년 4월 25일 수요일 오후 10:13That works great Ian! Thank you very much.