.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Using UserName to enable disable access to InfoPath form fields

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :SharePoint
Hi Everyone, I have created a browser enable form in InfoPath and restrict certain fields depending on the official logged on User Name. Now this works most of the time but my problem has to do with the "case" of User Names for some of the site users. In most cases the User Name is an exact match but for some reason, some user's names are reported by SharePoint (the Welcome at top of screen) with some parts captilized. Example - my hidden filed on the form reports my user name as xrs_master but the Welcome up top says XRS_Master - and the fields act as though I am not the correct user and won't enable. On the other hand there are users who's user name matches the case exactly and all works fine. Why is SharePoint reporting the user name differently? And if this is the reason they don't match, how do I fix it? Any Ideas? Many thanks in advance for help!

View Complete Post

More Related Resource Links

Changing fields while updating an InfoPath Form to a SharePoint 2010 Document library

My document library has following EventReceiver: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Receivers ListTemplateId="101"> <Receiver> <Name>EventReceiverDocumentLibraryItemUpdating</Name> <Type>ItemUpdating</Type> <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly> <Class>EventHandling.EventReceiverDocumentLibrary</Class> <SequenceNumber>10000</SequenceNumber> </Receiver> </Receivers> </Elements> Updating a browser enabled InfoPath form in the document library fires following event: Public Overrides Sub ItemUpdated(ByVal properties As SPItemEventProperties) Try Me.EventFiringEnabled = False properties.ListItem("Lastname") = "Testperson" properties.ListItem.ParentList.ParentWeb.AllowUnsafeUpdates = True properties.ListItem.SystemUpdate(False) ' solution 1 properties.ListItem.Update() ' solution 2 properties.ListItem.UpdateOverwriteVersion() ' solution 3 properties.ListItem.ParentList.ParentWeb.AllowUnsafeUpdates = False Me.EventFiringEnabled = True MyBase.ItemUpdated(properties) Catch ex As Exception Me.EventFiringEnabled = True E

How to identify new row in repeating table and repeating section of browser enable infopath form

Hello All,   I have Exp form that contain repeating table as well as repeating section. When i click insert new item it inset new row but i didn't got identification of that row. Is there is way to get identification of each row in repeating table as well as section.  Please help on this.  Thank you.

enable a button control on an InfoPath form based on another button control



is it possible to enable a button control based on another button control. so when a user click on a button it enable another button. only if the first button is clicked the second button can be click aswell


Sharepoint Access DB Infopath form


Is it possible to store the access database inside sharepoint with infopath as front end form.

My findings is; we have access database inside sharepoint but unable to desing infopath form for this.

Infopath 2007 Form with the repeating / non repeating fields in the same table



Hi ,

I am trying to create infopath 2007 form with the repeating / non repeating fields with in the same table. Basically i have to get the few column values  from the sharepoint List and remaining will be free text.


A     B   C     D      E    F  

x    x    x     e        a    y

x    x    x    s      s     g

x    x    x    h       t    w

x    x    x    j       h    t


X - Values getting from the sharepoint list by using repeating table

remaing values should be not repeating fields and  should be text fields.

anyideas on this. please let me know.



Validate Fields in InfoPath form 2010 before submit


I have designed a InfoPath form with some fields and a Submit Button which has got

Submit Action,

when the Submit button is clicked before it gets submitted to sharepoint list, i want ot validate all the fields

how could i do this

or should i use rules,

but using rules can i submit data to sharepoint list(if possible how)


Users who do not have permissions to access InfoPath 2007 web based form can view the form if someon


I have a SharePoint Form Library with an InfoPath form published to the form as the default template. The form library has several forms in it that have line item permissions. This is supposed to restrict who can view the form. If the user who has had their permissions removed navigates to the form through SharePoint the form does not display (this is expected behavior). However if the user is provided a link to the URL for the form then the can view the InfoPath form.

Here is an example of the link: http://moss.companyname.com/test/_layouts/FormServer.aspx?XmlLocation=/test/InfoPath%20Test/system2009-10-23T12_23_13.xml&Source=http%3A%2F%2Fmoss%2Ecompanyname%2Ecom%2Ftest%2FInfoPath%2520Test%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1

In addition I tried to put the forms into a folder and restirct the permissions on the folder, but the restricted users can still view the form.

When I removed the users permission to the form library then they got an error message.

I also tested this with a SharePoint list item and restricted permissions and this did not allow the user to view the item.


Infopath form in SharePoint export to SQL or Access


I have an infopath form on a sharepoint site.  Whenever users hit submit button data goes and sits in a table in sharepoint.  Instead I need to export all that information to a SQL table.

Anyone knows what is the procedure to do that?


INFOPATH: how can I calculate hours between 2 date fields in a list form


I am trying to calculate the number of hours between 2 date/time fields in a list form.

If I do this on a list view level with a calculated column, the column is not available for column summaries. Therefor I intend to use a regular number column and calculate the hours in an InfoPath form. Obviously the formula for calculated fields in list columns will not work in InfoPath.

Addition: I tried DateField1-DateField2, but the result is NaN...




Browser based InfoPath Form - fully trusted gives Access denied Error for few users


We have a code-based (code behind) browser based Infopath form which is fully trusted, but it gives out an Access denied error for some users.


The InfoPath form is not digitally signed. Let us know if this has to be done and what is the process for the same for DEV, STAGING and PRODUCTION.




How to Create Auto increment Request number for browser enable infopath form field Programmatically?

hi all,

i have created an infopath which have one request no. field and it will auto increment when click on add new item on sharepoint Document library

field contains (highest value of column request no. +1 )  when infopath will open in browser.

What i have done on this:i have create new data connection on sharepoint library and then pick document library then choose ID field and insert function in the field max(ID)+1.

help me



infopath form webpart/ anonymous access



I need the  anonymous users  to submit InfoPath List Forms via an InfoPath Form Web Part.

Currently when I go to a page with the InfoPath Form web part configured as an anonymous users I get the following error message:

Error loading the form

A form template (.xsn) file cannot be accessed. You may not have the required permissions to open the file

The list allows anonymous users permissions to add and view items

When logged in the form works fine.

I have setup the list settings for anonymous users to add items. but still the page with infopath form webpart is not opening.

InfoPath 2007: Designing Form Templates With The New Features Of InfoPath


InfoPath 2007 is an XML forms designer and editor, and a fully featured and integrated member of the Office family. This article takes a sneak peek at some of its new features.

Scott Roberts and Hagen Green

MSDN Magazine August 2006

ASP.NET: Selectively Enable Form Validation When Using ASP.NET Web Controls


Sometimes the extra controls that come with Visual Studio .NET can be a bit inflexible or they just don't provide enough functionality or flexibility for all situations. The ASP.NET form validation controls, while powerful and easy to use, require that the entire page be valid before it's submitted back to the server. Through the use of the new object-oriented features of Visual Basic .NET, it is possible to extend their functionality to overcome this limitation. This article tells you how and helps you decide when it's a good idea to keep validation on the client and when you'd be better off disabling it.

James M. Venglarik II

MSDN Magazine April 2002

SQL and Outlook: Enable Database Access and Updates Through Exchange and Any E-mail Client


Using Microsoft technologies, you can insert, edit, query, and delete database entries using any e-mail client such as Hotmail, Outlook, Yahoo, or even WAP phone. While e-mail is certainly a powerful and widely used tool, it is usually not integrated with an application for performing any tasks other than sending reminders. The application scenario described here, an e-mail-based SQL update program, uses a simple data model; however, this solution will apply to any data model that you are working with. It will also eliminate the need for complex n-tier Internet applications and serves as a low maintenance solution for providing data access.

Alok Mehta and Daniel Williams

MSDN Magazine January 2002

Checkbox disable/enable


I hope someone can be kind enough to help/advise me with this.

I have a web form with multiple checkboxes on it , with one of the checkboxes as the main (controlling) checkbox.  By this I mean that when this main checkbox is checked then all the other checkboxes need to be disable and when its unchecked these other checkboxes need to be enable.

I've found (plenty of) code to do this in javascript but i would really prefer to to it in vb(.net), if possible.

I hope all this makes sense to you.


Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend