Default filename for saving infoPath 2003 forms into SharepointLibrary?

  • Thread starter Newbie Programmer
  • Start date
N

Newbie Programmer

My infopath form has three fields:

1. UserName (string/char)
2. UserID (integer)
3. RegistrationDate (date/time)

I'd like the form name to default to: UserName-UserID-
RegistrationDate

When the user clicks on SAVE. So, for example if the user name in the
form was 'John Smith', the ID was 127 and the registration date was
2009-10-01, the default filename presented to the user upon save would
be:

John Smith-127-2009-10-01

I think I see the place in the customized save script to place the
code. However, I'm not sure what code I'd need to set this up. The
form is using VBScript...
 
E

.-=] ExTrEmE [=-.

My infopath form has three fields:
1. UserName (string/char)
2. UserID (integer)
3. RegistrationDate (date/time)
I'd like the form name to default to: UserName-UserID-
RegistrationDate
John Smith-127-2009-10-01

Very simple without code. I did it in infopath 2007 but i think 2003 is
exactly the same.

You need to setup a send data connection to form library. When you create it
the wizard ask for a file name.. here you can click on "fx button" and enter
a function to build a filename based on form field.
Insert function, choose string concat, then click ok
now you have the concat function with 3 palceholeders..double click on the
first and select the form field you want.
Do the same for other fields. You can add how many fields you want.
When done.. confirm. Then finish the connection wizard.
now create a button "SAVE", with a rule that submit the form using
connection.. and choose yours.
Done :)

I hope this help.

Sorry for my english and confused explanation :p
 
N

Newbie Programmer

Wow - what a great technique - thanks! Minimal programming. I never
would have figured this one out...

One thing though. There's no option for the user to make changes to
the filename. What I had in mind was something like the windows
filesave dialog - where you can set up an initial default name, but
the user can still override.

Is there a way to do this using the same technique?
 
E

.-=] ExTrEmE [=-.

Wow - what a great technique - thanks! Minimal programming. I never
would have figured this one out...

And with this technique if you have a Form Services you can publish and open
directly on browser.. if you wirte code inside the form you need the
administrator to publish the form if you want to open it in browser.
One thing though. There's no option for the user to make changes to
the filename. What I had in mind was something like the windows
filesave dialog - where you can set up an initial default name, but
the user can still override.
Is there a way to do this using the same technique?

So simple.. but I don't know if you like it.
Place a textbox named FileName to fill with the filename.
In the save button add a new rule (before the rule that save the form)
executed when FileName is empty .. then set FileName value with the formula
you wrote in the connection.
Then go in the form connection property and for module name.. clic on
formula button.. delete all the old formula.. then add a field.. obviously
the filename field.

So.. if filename filled by the use.. it take this as file name.. else if
blank.. it take your formula.
All clear? :)
 
N

Newbie Programmer

And with this technique if you have a Form Services you can publish and open
directly on browser.. if you wirte code inside the form you need the
administrator to publish the form if you want to open it in browser.


So simple.. but I don't know if you like it.
Place a textbox named FileName to fill with the filename.
In the save button add a new rule (before the rule that save the form)
executed when FileName is empty .. then set FileName value with the formula
you wrote in the connection.
Then go in the form connection property and for module name.. clic on
formula button.. delete all the old formula.. then add a field.. obviously
the filename field.

So.. if filename filled by the use.. it take this as file name.. else if
blank.. it take your formula.
All clear? :)

Hmm, yah that'll work. Is there a way to add a field to the form so
that it is visible, but so that it doesn't print when somebody prints
the form?
 
E

.-=] ExTrEmE [=-.

Hmm, yah that'll work. Is there a way to add a field to the form so
that it is visible, but so that it doesn't print when somebody prints
the form?

You can use views. You can set up view for printing.. where the field don't
appear..
 

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