Invoice Autonumber

J

JABarrett

I have customised the sample Invoice (one tax rate) form to be used within my
company. We do not have a Sharepoint server but do have an IIS server which
could host a web service. What I am looking for is information on how i would
create a web service that would link in to the infopath form so that:

a) upon opening the form it retrieves the last invoice number used and then
adds 1 to the value so it can be displayed in the infopath form correctly -
but does not update the value on the web service at this point

b) increases the value on the web service by 1 when a submit button is
pressed on the form

I am new to the concept of web services and as such I am not familiar with
the coding in them. Also what would be the best way of linking in the value
to the existing field on the form. Any help with this query would be much
appreciated.
 
E

ENathan

What if two or more users begin an invoice prior to any of them being
submitted? Won't you end up with invoices with duplicate invoice numbers?

With regard to generating unique numbers there are at least two approaches:

1. Get the max invoice number, which would be a field required to have a
unique value, from the invoice table and increment it by one.

2. Create a table with one column and one row to store the next available
invoice number. Then write a proc to lock the row, get the number, update
it, and release the lock.

This would be a good exercise to familiarize yourself with Web Services and
ADO.NET. When you create a new web service in VS 03 is shows a "Hello World"
example. You would need to add code to retrieve/update the invoice number in
the database, convert it to the string format needed are return it. Good
Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top