Function 'xdMath:Avg()' has failed in Infopath 2010 with SharePoint 2010 - InfoPath Dev
in

InfoPath Dev

Function 'xdMath:Avg()' has failed in Infopath 2010 with SharePoint 2010

Last post 11-28-2012 10:21 AM by Shaif G. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 11-28-2012 10:21 AM

    Function 'xdMath:Avg()' has failed in Infopath 2010 with SharePoint 2010

    I have a Infopath Form with Code base.

    While deleting a repeating section, it gives the error.

    In the logs, I got the error below:

    There was a form postback error. (User:  Form Name:  IP: , Request:  Form ID: urn:schemas-microsoft-com:office:infopath:CLW-Optimization-6:-myXSD-2011-04-13T13-18-14, Type: XPathException, Exception Message: Function 'xdMath:Avg()' has failed. Unable to cast object of type 'Microsoft.Office.InfoPath.Server.Xml.XPath.InfoPathXmlElement' to type 'System.Xml.XmlDocument'.) edebf1c8-a1a3-4369-a8a8-573ed5a3b61c

    I am using the Infopath fields and the calculated values as a column in the repeating table, which is having the formula:

    ((avg(WkndFnlAmb) * AmbPer) + (avg(WkndFnlFrzn) * FrznPer) + (avg(WkndFnlBatFrzn) * BatFrznPer) + (avg(WkndFnlCombo) * ComboPer) + (avg(WkndFnlCld) * CoolPer))

    When I am deleting the other repeating section, it will cause these values WkndFnlAmb, WkndFnlFrzn etc to be null which cause these 'xdMath:Avg() functions to get failed and cause the error.

    Please let em know how can I handle these exception by rules so that these Avg Functions did not throw any exception.

     

    Thanks,

    Shaif

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.