Lise,
There are three ways to approach your scenario:
1. During save, write this last used ID to a local file. Your solution
needs to be fully trusted or you will get a security warning based on
the zone.
2. Have a custom task pane and use IE's one of the many storage
mechanisms (e.g. userdata, cookie etc)
3. Write a web service and use secondary data source to query it for the
current order number.
I would recommend #3 as the most robust mechanism, especially if the
customer plans to roll out the form to several data entry persons (order
number generation process needs to be synchronized - a web service is
perfect for that).
Let me know if you need more help!
Good luck,
Alex @ Microsoft
-----Original Message-----
From: Lise [mailto:
[email protected]]
Posted At: Tuesday, May 10, 2005 11:59 PM
Posted To: microsoft.public.infopath
Conversation: Increment number
Subject: Re: Increment number
Hi Alex,
Thank you for your answer. Let me explain the entire scenario:
I have a customer who wants to use InfoPath for their Flight Requests
and
they want an ordernumber to be created automatically by InfoPath. We do
not
use any data source in this form, but we would like to be able to export
it
to Axapta later on (if needed). So when the user creates a request, the
ordernumber is filled in automatically with a structure like "FR-0001".
Is
this possible? The best thing would be to have an external file that is
updated, but I do not know how to accomplish that.
Thank you very much!
/Lise
Alex said:
Lise,
You can automatically generate order numbers on the database side. For
example, if you want to auto-increment PurchaseOrderID in the Orders
table, create a primary key for PurchaseOrderID that would
autoincrement, and create an InfoPath form template that allows users to
submit order details. In that form, users won't have to specify the
order number - and you don't need to worry about generating one. All
will be done on the database side.
If this doesn't work for you, please tell me more about your scenario;
why do you need to create a purchase order number on the client side?
Good luck,
Alex @ Microsoft
-----Original Message-----
From: Lise [mailto:
[email protected]]
Posted At: Tuesday, May 10, 2005 4:02 AM
Posted To: microsoft.public.infopath
Conversation: Increment number
Subject: Increment number
Hello,
I have searched this forum for an answer, but all I can find is
questions
regarding this issue - not solutions. What I want is an autogenerated
ordernumber that increments with +1 when opened and saved. What is the
best
solution to accomplish this?
I am new to VBscript, and C# and all other Microsoft programming
language.
Thank you very much!
/Lise