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

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

Publishing an Administrator Approved Form Programmatically

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :SharePoint

I'm hoping someone out there can help with this challenge?

I have a form that is being programmatically generated which I need to publish to SharePoint as, Administrator Approved. I need to use the form as a content type for the application we are developing which will live in SharePoint. 

I have no problem programmatically setting it to, "Full Trust" but I can't seem to find a way to programmatically publish the form as, "Administrator Approved". Don't worry about the bit in Central Admin with uploading the form template and activating it. I have that part working. Any help would be greatly appreciated!

Thanks for Your Help,


View Complete Post

More Related Resource Links

Programmatically activating an admin-approved form template to a site collection?



I am currently programmatically generating infopath forms with code-behind, and for each generated form, I need to be able to host the form template as a content type. Since I have a farm solution, I know that I would usually have to publish manually to admin-approved form template as opposed to form libraries or content types directly and afterwards create content types which reference those form templates. I was wondering what I would need to do to achieve the following results:

1) Programmatically activate a form template to a site collection (this is the big question mark for me)

2) Programmatically generate a content type which references said form template (I believe I already have this part down using the SP Object Model)

The environment I am building in uses SharePoint 2010 Enterprise Edition, InfoPath2010, .NET 3.5, VS 2010.

Any assistance would be MUCH appreciated.

Cannot upload administrator approved template InfoPath 2007 form: error "The 'ResetWebServerModeOnU


I've tried uploading several administrator approved InfoPath 2007 forms (including a totally blank form) to MOSS 2007 server, and all of the forms return an error on upload:

"Solution manifest for solution 'e38fa6a4-56ad-4d92-b87d-0e73bb5162ff' failed validation, file manifest.xml, line 2, character 84: The 'ResetWebServerModeOnUpgrade' attribute is not declared."

I've looked at the source files of the form, and can't find the 'ResetWebServerModeOnUpgrade' property in any of those files. I've searched and haven't come across anything mentioning this issue. I found an MSDN article explaining what 'ResetWebServerModeOnUpgrade', but I have no idea how to get that entry into the form. This is the only way to publish this form because of a specific data connection, so just publishing into the site directly from InfoPath is not an option.

Further details:
MOSS 2007 32bit Farm (1 app/web, 1 SQL, both Server 2003), Oct 2010 CU's installed
InfoPath 2007 set to web compatible
Attempted upload via Central Administration > Application Management > Manage Form Templates > Upload Form Template
Tried both options in that menu & "Verify" passes
I have full admin rights to the farm.

Any help would

Programmatically create an InfoPath form


I'm programmatically creating an InfoPath form using this article: http://www.bizsupportonline.net/infopath2007/programmatically-create-infopath-form-console-app.htm.


Everything works well up to 29 fields (my:field1 ... my:field29). After that it runs without an error and posts a form to the library however the icon does not switch to an infopath icon and the filename stays blanks. I don't believe this field specific, it seems to be happening when I use any 29 to 30 fields so I'm thinking its a memory issue with the stream reader.

Has anybody every had this issue before, is there a way to fix this?


"Enable this Form to be filled out by using a browser" check box is grayed out when publishing InfoP

When I try to publish InfoPath form to a SharePoint site collection, "Enable this Form to be filled out by using a browser" check box is grayed. Also, I see the following warning message: This form template is br owser-compatible, but it cannot be browser-enabled on the selected site. This may be cased by one of the following reasons: -The server is not running InfoPath Forms Services. - The necessary features are not available on the site collection. The policy setting on the server does not allow user to browser -enabled Form templates. I have tried the following: 1. Deactivated and reactivated " office SharePoint Server Enterprise Site collection features" 2. Deactivated and reactivated " office SharePoint Server Enterprise Site features" 3. "Form Templates" document library exists and visible. 4. I am able to check the box in other site collections without any problems. 5. Ran the following stsadm commands: STSADM.EXE -o deactivatefeature -filename IPFSAdminLinks\feature.xml -url http://siteCollection -force STSADM.EXE -o deactivatefeature -filename IPFSSiteFeatures\feature.xml -url http://siteCollection -force STSADM.EXE -o deactivatefeature -filename IPFSWebFeatures\feature.xml -url http://siteCollection -force STSADM.EXE -o activatefeature -filename IPFSAdminLinks\feature.xml -url http://siteCollection -force STSADM.EX

The URL is not valid error while publishing InfoPath form to MOSS 2007 server

Hi All,   When I try to publish the form onto a SharePoint Team site it throws the error: The following URL is not valid : http://tcs037288:6543/sites/projectmanagement   I have checked the comaptibility, trust and everything looks fine. Also, I tried to upload this template from Central Admin but there it is failing with browser-compatibility errors.       Regards,

InfoPath 2007 - Publishing Creates multiple columns on SharePoint Form Library (GUIDS apparently are

I have been working this issue for 2 days now.  This has happened to me in the past and I was able to work through it.  It doesn't appear that this time I am going to be so lucky. Issue Description: When publishing an InfoPath form a new column is created that has the same name as the correct one, but a new GUID is created. Troubleshooting steps: I have read this article: http://www.delphi-ts.com/blogs/lozzi/post/2009/06/03/Duplicate-site-columns-in-MOSS-from-InfoPath-Forms.aspx   This was the solution the last time I had this problem.  However, no matter what I do, it is not working now.  I have a column named User Name which is the username of the person that submitted the InfoPath form for use with my Visual Studio workflow.  When the workflow kicks off, it reads this column and attempts to get the value.  The value is blank because a new column with the name User Name now exists and that is where the value is stored.  I attempted to fix it by remapping the GUIDs as described in the article.  I also reverted the code to a previous version from TFS.  None of these worked.   I now have 3 columns called User Name and I can remap the GUID to the second column and third column.  But when I try to map it to the first column (the one I need) it doesn't work. The first column that is circled is the correct column. 

Can we change the site administrator programmatically?


Hi all,

I need to change the site administrator through programmatically...So Please tell me how can we do this...

thanks in advance....

Administratively-Approved Form Templates not updating in Form Library


I did not have this problem for non-administrator-approved templates.

I have managed codes for an administrator-approved templates. After I made C# changes to the template, tried all kinds of way, have the newest version in the forms template doc lib, however, the form document library still refers to the old one, even after I clear the infopath cache folder as RW_IOWA recommended.

I feel the upload/upgrade template page in central admin should take care of this changes, the document lib using the form template should automatically get the changes.

Anywhere could I make a mistake?


How to redirect Infopath form programmatically on button click


I am having an issue with infoPath Forms and C#, 
I have a 1st form open to the user, and when he click a button it opens a 2nd form.

Sounds pretty easy, but I have tried many ways and still error.
(environment is InfoPath Forms 2007 in Sharepoint and code: C#)

this is what I have:
- form1 . a text field where I enter the URL of form2
            . a button with code below

The issue is that if I type the URL of form2 
 in the text field and press the button I get this error
"Critical Error : An error occurred submitting this form to the Web server. The form will now be closed."

But instead of the URL of form2.xsn I type http://www.google.com/ they it works (w

Bulk Infopath form publishing

We have hundreads of infopath forms and publishing individual forms is a painful process, i am wondering if there is any tool available to do bulk publish ?

creating new item in form library programmatically


Hi all,

I have a form library with infopath form published in it. I am trying to create a new item programmatically in it which will contain a instance of the published infopath form. But its suggesting me to use SPFileCollection.Add() for that.


Can anyone show me some light how I can meet my requirement?



Setting Options Programmatically in Visio 2010 for Publishing to SharePoint Server 2010

Explore how to programmatically save Visio 2010 diagrams as web drawings for use with Visio Services in SharePoint Server 2010.

Programmatically create publishing page and fill with content.


I have a bunch of HTML which has been exported from a different platform.
This HTML could be located in a database or contained within an HTML file. 

I am looking for some guidance on the best way to programmatically create a publishing page in SharePoint at a specific site location, then populating the RichHtmlField Publishing Web Control (PublishingPageContent) with the HTML that has been exported from one of the sources mentioned above.

Any suggestions/advice you can offer will be much appreciated.


Turn on publishing programmatically when a subsite is created


I have a Site Collection with Publishing Site Template. I would like to have the publishing turned on automatically whenever a non-publishing subsite is created. Upon searching, I found there are two options. one with site definition and another with feature stapler.

I am new to .NET coding. Any code references to implement the above solution would be helpful.

Programmatically Mapping Custom SharePoint Column on Non-browser Enabled InfoPath Form


I have an InfoPath form, which, due to control requirements, is not browser enabled. It is being programmatically added as a content type to SharePoint (MOSS 2007). All users have Office 2007 installed so they will be able to open the form. I also have a custom multi-line column in the SharePoint document library. I can manually publish the form and map the column to a field of the form, but I need to be able to do this programmatically.

We are currently deploying the forms by modifying the publish url in the xsf during install. We have tried to modify the site coulmn GUID in the template xsf during install without success.

Does anyone have any ideas as to how we can programmatically promote the InfoPath field so it is visible in SharePoint?

Retrieve the list ID of a programmatically-submitted infopath form

I'm using the DataConnections["SUBMIT"].Execute() method to submit my InfoPath form to a document library.  However, later in the custom code I need to reference back to the submitted form (I need the ID and the title).  Is there a way to gather this information while submitting?

publishing an InfoPath form to SharePoint 2010


I have an InfoPath 2010 form that needs to have a repeating table so when I developed it as a SharePoint Form Library.  When i attempt to publish the form to a SharePoint 2010 site i constantly get an error stating "The following URL is not valid".

I know that the URL is correct and I do have different forms on the site.  The main difference between this form and others on the site are the repeating tables, and the other forms were created as SharePoint Lists.  

Any ideas?

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