June 23, 2004

OnAfterChange event handling

Just found this at MSDN: Working with Secondary Data Sources in the Information Lookup Developer Sample Form. This provides some good tips on creating scripts to fire with the OnAfterChange event.

My goal is to create a script that fills out following fields when one item is selected. With Jan Tielens script as a start, I have this working OK for a sharepoint list secondary data source, but I am having trouble selecting the correct nodes from an XML file obtained using the method posted earlier today.

Posted by Jeffrey to the InfoPath category at 11:25 PM | Comments (0)

Retrieving filtered sharepoint lists with InfoPath

Dustin at the sharepoint university has blogged about extracting XML from Sharepoint with a properly formatted URL: Don't forget: Web Services/SOAP isn't the only path to XML from SharePoint. This and some thoughts on InfoPath had me intrigued.

As I have blogged before, Jan Tielens has shown in is blog how to connect to a sharepoint list from Infopath SP1. I had this working, but I could not see how to filter items and only retrieve those in a specific view of a sharepoint list. And I do not have local access to establish custom web services.

Dustin's XML retrieval process fills the gap! Here's how to do it.

In InfoPath, open an empty form and place a list box control on it. Double click the control, and click Add... beside Data connection. Then select XML document and click Next. Now you need to enter the complete URL that you obtained using Dustin's procedure (including the &View= parameter if you want use a specific view). Click Next, and InfoPath will make the connection.

Now you need to select the Entries, Value and Display name. The available fields will be those that are defined in the sharepoint view, and they will be listed under rs:Data in the XPath dialog. (I found that the field names were nothing like the actual list fields, so some trial and error was required.) Once you have selected the target items, preview your form.

Voila! - a drop down list populated with the items from a sharepoint list, filtered (and ordered) using the view of your choice. And not a web service, SOAP or custom script in sight. If you like this idea, I would love to hear your feedback.

Posted by Jeffrey to the Sharepoint category at 04:44 PM | Comments (0)

June 06, 2004

Law enforcement

I have this long-standing question regarding speed cameras to which I have been unable to find a satisfactory answer: if you speed past two cameras without slowing down, is that one or two speeding offences?

Don't say two, because the answer is not as straight forward as it may seem. What if the two cameras are only 100 m apart? 10 m? In the same van and fired 0.01s apart?

Come to think of it, why not put 12 camera's in one van and fire them .001s apart? That way, even with the minimum demerit point speeding offence in Queensland, the driver would lose their license. There would be no opportunity for repeat offences, the road would be safer and the traffic load on our highway network would be reduced.

I am surprised some dimwit bureaucrat has not clicked to the potential of such a practical and cost effective enforcement measure. They have come up with plenty of other equally stupid ideas.

In the meantime, I would still like a definitive answer to my question.

Posted by Jeffrey to the Miscellaneous category at 03:23 PM | Comments (0)

June 01, 2004

Infopath and sharepoint lists

Objective: a timesheet form created in InfoPath that records time spent on multiple projects, and accesses existing sharepoint lists for project and worker details. The form would be published in a form library on a sharepoint site for distribution.

The answer: well, I had just been reading about secondary data sources, and I think Jan Tielen's article Utilize the Secondary DataSource Data in InfoPath (SharePoint List Example) is exactly what I was after. Evidently the book I bought on InfoPath was before SP1, as they do not mention lists as secondary data sources.

Now I am left to create the form and see how it goes! I shall post the results when it is complete. Thanks, Jan.

Posted by Jeffrey to the Sharepoint category at 02:08 PM | Comments (0)