Infopath questions-NewBie

S

Snigdha

Hi,

I recently started using Infopath and I am having problem in achieving some
functionalities:-

I created a Infopath template. It creates a xml file when I fill the
form.But I want these functionalities,How do I add them?

a. Say I have 2 text fields in the form A, B. I want the xml file to be
named based field B's value that the user filled in the form. Also I want to
save this xml file on a particular location in my machine(c:\A's value\B's
value.xml or a virtual directory(http:\\mysite\VirtualDir name\A's value\B's
value.xml). How do I do this?

b. I want to check if the user accessing my form (if it's published in a
network share) is from a particular security group. If yes, then only I let
him open the form otherwise not. How do I do this?

Thanks,
Snigdha
 
L

Laurie_Marsh

I achieved these two features by adding code behind the form. InfoPath
allows you to create handler functions for the OnSave or OnSubmitRequest
depending on the command you are using in your form. For saving the form to
a file you can use thisXDocument.SaveAs(sFileName); in your handler.

There is also an OnLoad even that will allow you to check out who the user
is and then determine their security group. In yoru handler you can use
System.Environment.UserName to determine the user.

Hope this helps.
 
S

Snigdha

Hi,

I tried to save the xml in my virtual directory. But it gives me access
denied
error. As I am new t Infopath its possible that I did something wrong. I
used the SaveAs command.

Can you please share some sample code with me.

Thanks,
Snigdha
 

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