Submit and Email at same time

G

GTP

I am in the process of making a form in Infopath with a data-connection to a
MSDB I made. The form I made looks and works well, when I click "Submit"
located at the top of the form (submit button in infopath form by default) it
sends the information to the database, thats awesome. How do I get the submit
button to send to the database and at the sametime send all the information
in the form to an email recipient?

I may have a second problem, some users using this form will not have
Infopath. The form and database I will post on our Intranet, companyweb.

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Hi Greg,

You will need to setup another "data connection" that does a "submit" to an
e-mail. Then instead of using the built-in Submit button, you will need to
add a button to your form - you will then use a "Rule" to execute both the
submit to your database and the submit to your e-mail.

Let me know if you need more detail on how to set this up. In regard to
your 2nd comment - each user will need to have InfoPath installed in order
to interact with the data. We have a Knowledge Base article on how to
display the data in IE with the "look and feel" of InfoPath but it is not
editable.

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GTP

Scott,

Thanks, your solution works just great. I have a question. I published the
form to our intranet, does this mean that the database was published at the
same time to the intranet or is the dataconnection still pointing to my
computer where I made the database? If I need to change the location of the
database file on my server, do you have any ideas as to what directory or
folder I should put it into? Would it go into the same root folder as the
form on the intranet? Would I then have to go back into the form and point it
to its new location?

One more question. Instead of submitting the form as an attachment, is there
a way to populate all the fields into the email message instead?

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Hi Greg,

I'll address each question individually:

- "I published the form to our intranet, does this mean that the database
was published at the same time to the intranet or is the dataconnection
still pointing to my computer where I made the database??
not the database. However, whatever path to the database you specified when
you created the solution is the path that is stored within the solution. As
such, this needs to be a path that everyone that will be using the form has
access to.

- "If I need to change the location of the database file on my server, do
you have any ideas as to what directory or folder I should put it into?
Would it go into the same root folder as the form on the intranet?"
used for, it's exposure to the Internet, etc. there may be security issues
you would want to consider but where you put that database is a decision
you and your company would need to make.

- "Would I then have to go back into the form and point it to its new
location?"
the Tools menu, select: Convert Main Datasource and simply complete the
wizard by selecting the database from the "shared" location.

- "Instead of submitting the form as an attachment, is there a way to
populate all the fields into the email message instead?"
View in the body of the message. This can be done programmatically but the
data is basically read-only. So if you need user intervention, this is the
way.

The other option would be to implement either a shared location for all the
forms created from the XSN or use Sharepoint as a central repository for
all forms. This way, you would only need to e-mail, say, a link to the form.

I hope all this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GTP

Thanks for the reply Scott,

Regarding where the database should reside on the server, I can put it
anywhere, I'm using SBS 2k3 Standard, I created in C:Documents and settings/
a folder for the database, since I can put it anywhere I was wondering if I
should use this directory. I didn't want to put it into a user folder. I
don't want anyone to have access physically to the database so I didn't put
it into a shared folder. Which leads to my next question, since we will be
submitting and retrieving data to this database, do I need to share the file?

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Hi Greg,

Yes - even though you are storing the InfoPath template on a server, it
will open locally on the user's machine. So if you have a hard-coded path
to C:\MyFolder, the user needs to have this folder on their machine with
the database in there. Since this is not practical, the database needs to
be in a shared location that uses have access to. You would then need to
modify the connection (Convert Main Datasource) and use a path such as:
\\server\shared folder\YourDb.MDB.

Best regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GTP

Scott, thanks I got it all worked out. I have another question, you know when
you publish to a sharepint library it puts the form in the "Documents" and
then a "document library", so if I called my from "jobsiteForm", the form
would be under "Documents" and then the Document Library "jobsiteform". One
you click jobsiteform it opens a page. On the top of the page is the "Fill
out Form" which is not to user friendly for some of our users.

What I would like to do is have under "Documents" in the quick launch a
directory called "Forms", then once the user clicks on Forms it brings up all
the different links to all the different forms, so once they click the form
they want, a page opens with the form and they are filling it out. I want
them to click a link to a form and have it open and not click the actuall
file for the form.

I hope you see what I am trying to explain. Sorry if it does not make sense.

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Hi Greg,

Glad to hear it's working for you!

In regard to your follow-up question, let me see if I understand: you would
like to have a link under the "Documents" section of your main Sharepoint
page that, once clicked, would allow the user to see all of the forms in
the library - is this correct?

If so, then this is simply a setting on the library. Navigate to your
library, click Modify columns and settings, click Change general settings
and then enable the option: "Display this document library on the Quick
Launch bar."

Now once this is done you should have a link to that library on the Quick
Launch bar of your main site. When you click on this link you should see
all of your forms that have been saved to that site - if you do not, then
the URL that you are using to submit the forms is too "deep." For instance,
when you setup the submit connection the URL should be like this:

http://server/library

If you set it up as:

http://server/library/forms

This would be incorrect.

Does this help or am I misunderstanding your question?

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GTP

this is the link to the form, I copied this from my companyweb.

http://companyweb/Manual Request/Forms/AllItems.aspx

I did as you said in the navigation tool for the quicklaunch. What I really
wanted todo was in the quicklaunch have a link called forms, when forms is
clicked the "jobsiteForm" hypertext will be visible along with any other
forms I make and put into this library.

Currently, if you click the QuickLaunch, it brings you right into the page,
where towards the tp of the page there are clickable headings, one being
"Fill out this form", or "Upload Form", etc.

I also thought the fields on this page would display the data in the
database when a form was filed out, the fields display noting.

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Greg,

My apologies but as I am not a Sharepoint "expert" you may have better
success pinging that Newsgroup to see if you can modify the behavior of the
library/site.

With regard to the question of the fields on the page displaying the data
in the form - when you published the form did your specify the fields to
promote to columns in Sharepoint?

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GTP

Hi Scott,

I figured out the problem. I thought when you submit the form that it saved
somehow which will populate the colums on the sharepoint site, actually you
have to save the file first, which will populate the columns, and then
submit, which leads to my next question.

I think it may be ackward for the user to figure out a name to save the form
under, is there a way in code or an option in infopath for the form have a
save name automatically by maybe pulling data from a few of the fields in the
form? The form will always save to the sharepoint location so if the location
needs to be in the code.

Thanks,
Greg
 
S

Scott L. Heim [MSFT]

Hi Greg,

Yes - when you create your "Submit" connection to Sharepoint the second
screen is where you specify the form name. You can click the button next to
this field and insert either a field from your form or choose to insert a
function where you can select the "concat" function to pull in multiple
fields.

Let me know how this works for you!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Top