bkleynbok, the equivalent of your View-setting code in the new object model is: string viewName = MainDataSource.CreateNavigator().SelectSingleNode("//mstns:D_VIEW", NamespaceManager).Value; e.SetDefaultView(viewName); - Ned
(Thanks for correcting an original version of this comment, I've deleted your correction and updated this to make it easier to read for future comers)
bkleynbok, the way to submit through code in the new object model is: DataConnections("NAME AS ENTERED IN THE DATA CONNECTION WIZARD").Execute(); If you have a connection that can be used for both submit and query, then you can cast it to the appropirate type first to control what Execute does. For example, the following will submit a database connection: ((AdoSubmitConnection)DataConnections("NAME")).Execute();
- Ned
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples
Any way to specify a form template to use for rich client and different template to use for the browser?
To BobC: you can't do different templates for rich client vs browser easily. However, you can create different views within the same form template, and switch to an appropriate view depending on whether you're using a rich client or browser.
- Alex
I've tried to call this.Submit() method from code when the Form Submit is set to Custom Code
Hi,
I have a question regarding connecting two infopaths.
How can we connect two infopaths through a common column?
I have an infopath with CustID1 and this infopath contains another file
attachment(infopath) and I have to popup the second infopath with the same
CustID1.
I tried the following code in the OnLoad event.
try
{
string strCustID = e.InputParameters["CustID"];
DataSource dsCustomers = this.DataSources["GetCustID"];
XmlNamespaceManager ns = this.NamespaceManager;
XPathNavigator xnCustomer = dsCustomers.CreateNavigator();
XPathNavigator xnCustomer = xnCustomer.SelectSingleNode("/dfs:myFields/dfs:queryFields/tns:Customers/tns:CustomerID");
xnCustomer.SetValue(CustomerID);
dsCustomer.QueryConnection.Execute();
}
catch (exception e)
messagebox.show(e.message,"Error");
but encountered the following error:
System.Collections.Generic.KeyNotFoundException was unhandled by user code
Message="The given key was not present in the dictionary."
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Office.InfoPath.Internal.ReadOnlyDictionary`2.System.Collections.Generic.IDictionary<K,V>.get_Item(K key)
at Customer_Checklist.FormCode.FormEvents_Loading(Object sender, LoadingEventArgs e)
at Microsoft.Office.InfoPath.Internal.FormEventsHost.OnLoad(DocReturnEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)
Is this the process for transferring the value of a field from one infopath to another infopath.
Thanks in Advance
I have an issue in updating db table.
I tried the code given by tronn.
(DataConnections("NAME AS ENTERED IN THE DATA CONNECTION WIZARD").Execute(); ).
but I am unable to update my database table.
Any clues for this????