S
Scott at RVC
Hi All,
The user makes a "Patient Name" selection from a dropdown list.
The "Patient Name" is used as a parameter in a webService to obtain
all the patient's data.
below is my code, i get an object not set error. Please could someone
guide me.
// The following function handler is created by Microsoft Office
// InfoPath. Do not modify the type or number of arguments.
[InfoPathEventHandler(MatchPath="/myrototype/my:cboPatient",
EventType=InfoPathEventType.OnAfterChange)]
public void cboPatient_OnAfterChange(DataDOMEvent e)
{
if (e.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}
// Get a reference to the Web Service
// NOTE: SelectSinglePatient is the data connection name.
IXMLDOMDocument3 wsDOM =
(IXMLDOMDocument3)thisXDocument.DataObjects["SelectSinglePatient"].DOM;
// Set the SelectionNamespaces so that you can find the correct field
wsDOM.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\""
+ " xmlns:s0=\"http://tempuri.org/ManagedCodeWebService/Prototype.asmx/\"");
// Set Web Service parameters
// NOTE: SelectSinglePatient is the data connection name.
// NOTE: strFullName is the webservice parameter name.
// ** ERROR HERE **
wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:SelectSinglePatient/s0:strFullName").text
= thisXDocument.DOM.selectSingleNode("/myrototype/my:cboPatient").text;
// Requery the webservice datasource
// NOTE: SelectSinglePatient is the data connection name.
thisXDocument.DataObjects["SelectSinglePatient"].Query();
}
Thanking you in advance.
Scott
The user makes a "Patient Name" selection from a dropdown list.
The "Patient Name" is used as a parameter in a webService to obtain
all the patient's data.
below is my code, i get an object not set error. Please could someone
guide me.
// The following function handler is created by Microsoft Office
// InfoPath. Do not modify the type or number of arguments.
[InfoPathEventHandler(MatchPath="/myrototype/my:cboPatient",
EventType=InfoPathEventType.OnAfterChange)]
public void cboPatient_OnAfterChange(DataDOMEvent e)
{
if (e.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}
// Get a reference to the Web Service
// NOTE: SelectSinglePatient is the data connection name.
IXMLDOMDocument3 wsDOM =
(IXMLDOMDocument3)thisXDocument.DataObjects["SelectSinglePatient"].DOM;
// Set the SelectionNamespaces so that you can find the correct field
wsDOM.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\""
+ " xmlns:s0=\"http://tempuri.org/ManagedCodeWebService/Prototype.asmx/\"");
// Set Web Service parameters
// NOTE: SelectSinglePatient is the data connection name.
// NOTE: strFullName is the webservice parameter name.
// ** ERROR HERE **
wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:SelectSinglePatient/s0:strFullName").text
= thisXDocument.DOM.selectSingleNode("/myrototype/my:cboPatient").text;
// Requery the webservice datasource
// NOTE: SelectSinglePatient is the data connection name.
thisXDocument.DataObjects["SelectSinglePatient"].Query();
}
Thanking you in advance.
Scott