Так тоже не работает.
Пробую каждое поле проверять, тоже не работает:
Цитата:
// Check for errors.
var errorCount = resultXml.selectNodes('//error').length;
if (errorCount != 0)
{
var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
alert(msg);
}
// Display the retrieved value.
else
{
if (resultXml.selectSingleNode("//q1:telephone1").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:telephone1").nodeTypedValue);
crmForm.all.telephone1.DataValue = resultXml.selectSingleNode("//q1:telephone1").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:name").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:name").nodeTypedValue);
crmForm.all.companyname.DataValue = resultXml.selectSingleNode("//q1:name").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:address1_line1").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:address1_line1").nodeTypedValue);
crmForm.all.address1_line1.DataValue = resultXml.selectSingleNode("//q1:address1_line1").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:address1_city").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:address1_city").nodeTypedValue);
crmForm.all.address1_city.DataValue = resultXml.selectSingleNode("//q1:address1_city").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:address1_stateorprovince").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:address1_stateorprovince").nodeTypedValue);
crmForm.all.address1_stateorprovince.DataValue = resultXml.selectSingleNode("//q1:address1_stateorprovince").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:address1_postalcode").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:address1_postalcode").nodeTypedValue);
crmForm.all.address1_postalcode.DataValue = resultXml.selectSingleNode("//q1:address1_postalcode").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:address1_country").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:address1_country").nodeTypedValue);
crmForm.all.address1_country.DataValue = resultXml.selectSingleNode("//q1:address1_country").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:revenue").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:revenue").nodeTypedValue);
crmForm.all.revenue.DataValue = resultXml.selectSingleNode("//q1:revenue").nodeTypedValue;
}
if (resultXml.selectSingleNode("//q1:numberofemployees").nodeTypedValue != null)
{
alert(resultXml.selectSingleNode("//q1:numberofemployees").nodeTypedValue);
crmForm.all.numberofemployees.DataValue = resultXml.selectSingleNode("//q1:numberofemployees").nodeTypedValue;
}
}
Неужели никак нельзя это реализовать?