If you are working in InfoPath form with source code, you must elevate your form to "Full Trust" as its required to access the SharePoint server and its files.
On design , Select the file->Form Option->under Security and Trust category, select the "Full trust" security level and save and publish.
Here is the simple entry form with three column,that will insert the item in SharePoint list through C# object model.
public void CTRL5_5_Clicked(object sender, ClickedEventArgs e)
{
using (SPSite FormSite = new SPSite("http://win-oq6s840ais1/"))
{
using (SPWeb FormWeb = FormSite.OpenWeb())
{
SPList list = FormWeb.Lists["Register"];
SPListItem item = list.Items.Add();
item["Title"] = GetDomValue("/my:myFields/my:ddlTitle");
item["FirstName"] = GetDomValue("/my:myFields/my:txtFirstName");
item["LastName"] = GetDomValue("/my:myFields/my:txtLastName");
FormWeb.AllowUnsafeUpdates = true;
item.Update();
// Set AllowUnsafeUpdates back to 'false' to prevent further updates to the database.
FormWeb.AllowUnsafeUpdates = false;
}
}
}
private string GetDomValue(string XpathToGet)
{
return this.CreateNavigator().SelectSingleNode(XpathToGet, this.NamespaceManager).Value;
}
Showing posts with label InfoPath 2013. Show all posts
Showing posts with label InfoPath 2013. Show all posts
Wednesday, September 09, 2015
Wednesday, February 25, 2015
InfoPath 2013 form SharePoint
I posted one article in the Microsoft Technet wiki about the what is the future course of the long lasted InfoPath form in SharePoint 2013 and SharePoint 2016.
And also some prediction on what could be the successor of the InfoPath form technology at end of the article , may be I am not sure on this but 80 percent of chances there those technologies can be used to future form technology.
Read further @ Technet
Future of the InfoPath 2013 form
And also some prediction on what could be the successor of the InfoPath form technology at end of the article , may be I am not sure on this but 80 percent of chances there those technologies can be used to future form technology.
Read further @ Technet
Future of the InfoPath 2013 form
Subscribe to:
Posts (Atom)
