Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am missing the developer ribbon in my infopath. Do I need to reinstall infopath from scratch? Or is there an add-in which I can perform to get the code piece for infopath.

I am trying to write some code on form load in c#. Is it possible?

http://i.stack.imgur.com/SWsNW.png

share|improve this question
add comment

2 Answers 2

Open up infopath designer (there should be a shortcut, but if not you can open command prompt, navigate to the exe, and type 'infopath.exe /design')

Go to File -> Options

In the Infopath Options Menu click on the Customize Ribbon sidebar tab

Under Main Tabs there should be an unchecked 'Developer' item, check that and your good!

Once you have the Developer ribbon there, you can simply click the On Load Event button under the Events section within the developer tab and it will open up the code window. Keep in mind it (at least for me) defaults to VB, so you have to open up form options, go to programming, and change the form template code language to c#

share|improve this answer
    
When I open InfoPath from Start > Program Files then I see the Developer Tab. However, when I click Customize Form from SharePoint List/Library then Developer tab is gone in spite developer ribbon is checked. See the print shots of both scenario. i.stack.imgur.com/SWsNW.png –  Angie Heimerlake May 24 '12 at 16:27
2  
That is because custom code is NOT allowed for New/Edit/Display Item forms. You can look into the things available for non-code infopath solutions, but i would need to know what you are trying to do to help you out in that regard. If you need to write code based infopath form, you have to use a Form Library and upload it through central admin –  Zork May 24 '12 at 16:30
    
I been trying to implement hide/disable fields based on SP Groups. So i followed few articles where they talk about using userGroup.asmx web services to hide or disable fields. I could not get the userGroup.asmx to work (even after modifying the xsd files). So I was thinking may be I can use c# code to achieve the same goal. so form load I need to hide few fields based on sp group that current user is in. Hope this makes sense. –  Angie Heimerlake May 24 '12 at 16:33
    
I think i understand, and it makes sense (have you tried blog.symprogress.com/2011/05/… and info.akgroup.com/blog-0/bid/69277/…), and you can definitely do this type of thing with c#, but again it cant be easily implemented with list forms. There are alternatives like using a non-infopath form and hiding with javascript (sharepointjavascript.wordpress.com/2012/05/07/…) –  Zork May 24 '12 at 17:21
    
This as well for non-infopath forms sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=168 –  Zork May 24 '12 at 17:33
show 1 more comment

You'll find the option for enabling the developer ribbon using these instructions

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.