Tuesday, May 15, 2007

Infopath 2007 sequential counters

I needed to create an Infopath form which would create a sequential invoice number. I am publishing the form to a MOSS Forms library and using the browser to edit the form.

Easy, I thought... I'll just connect a second data source to a SQL server stored procedure to give me the next invoice number - BUT this seemed to break the browser compatibility no matter what configuration I tried.

This is the SP code - (crude but effective for what I needed)
ALTER Procedure [dbo].[NextInvoiceNumber]
@NextNumb INT OUT as
begin
update lookup
set NumValue=NumValue+1
where Header='InvNumb'
select @NextNumb=NumValue from lookup where Header ='InvNumb'

So attempt two was to use Web Services. (I am new to these but used to do a lot of COM+ distributed applications 0 so how difficult can it be?). Well it turned out very easy to write and debug the web service using VS2005, however deployment was an absolute nightmare.

Ive documented solutions to all the web service deployment problems I found in this post

No comments: