Infopath 2007 : Need to use managed code for browser based forms

A

Atul Nisar

Hello,

1.

I need to hide, disable certain portion of my Infopath form based on user
role.

I am publishing my form in Sharepoint 2007 Server.

The form will be opened in browser by the end users.

How can I do this.



2.



Can we write managed server side code in browser compatible infopath 2007
forms?

We are trying to do this by using Visual Studio Tools for Application (VSTA
) but we get error while publishing this browser compatible infopath form
 
J

Josh

You can do it with conditional formatting. No code involved.

Put the portion in a section then conditional format the section based
on the users role. Put the fields you want inside the section.

Josh
 
A

Atul Nisar

Hi Josh,

Thanks for the reply.
The user roles are not available for browser compatible forms.
We are able to use the managed code now.
We need to query AD using LDAP to retrieve user roles in managed code.
 
J

Josh

If you are wanting to do this server side, you'll have to make a
webservice that querys AD for you and then call that webservice from
your form.

I have some C# code that querys AD. By using code behind the form,
you'll need to sign it. I had implementation problems with a
webservice, but they're are examples out there.

Use this lab as reference. This is where I started.

http://msdn2.microsoft.com/en-us/office/ms788214(office.11).aspx
 
A

Aza

Hi Atul .. i am currently working on a simmular problem where by users that
are logged in see one view and anonymous users see another..

This works fine for logged users however when the anonymous user loggs in an
exception is thrown: HttpException, Exception Message: Server cannot set
status after HTTP headers have been sent.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
if (User is Authenticated)
e.SetDefaultView("Secure");
}

Any feed back would be appreciated Thanks
 

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