InfoPath 2013 Custom Task Pane (html), cannot access methods in FormCode via XDocument Extension property, unspecified js error RRS feed

  • Question

  • In InfoPath Designer 2013 I have created a blank form (InfoPath Filler) and added a html Custom Task Pane to it.

    I did this in the way described in the documentation, via Form Options > Programming, Enable cutom task pane and pointed the Task Pane location at a very simple html file.

    Under Security and Trust I have set the Security Level to Full Trust.

    So far so good, but when I preview the form or debug it from the Code Editor (in VS2012) I always get a js 'Unspecified error ...' when the js tries to call a method that is defined in the FormCode.cs.

    I added the method and js as per the documentation in

    This states an example as below which I'm using:

    In the following example, a method called myCustomMethod of the InfoPath project class can be accessed from the custom task pane using the Extension property:


    //Custom method added to the project

    public string myCustomMethod() { return"Method value"; }

    To access myCustomMethod from the custom task pane, use the DHTML external property of the DHTML window object:

    objXDocument = window.external.XDocument; myString = objXDocument.Extension.myCustomMethod();

    The error always occurs when the myCustomMethod() is attempted to be called from the html file.

    I have a similar project on a separate machine using InfoPath 2010 (and the machine only has Office 2010 installed), and this scenario works fine.

    So has something changed for InfoPath 2013? I've searched everywhere for a solution but have not found anything.

    Does anyone have or know of a working code sample in InfoPath 2013 with a Custom Task Pane with working communication from the task pane to the form code?



    • Moved by George Hua Friday, January 17, 2014 3:27 AM not a VSTO issue
    • Moved by George Hua Friday, January 17, 2014 10:12 AM VSTA
    Thursday, January 16, 2014 3:09 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    >> So has something changed for InfoPath 2013? <<

    You could access the link below to find if this is helpful:

    What's New for InfoPath Developers

    In addition, Infopath uses Visual Studio Tools for Application to Editor Code:

    This is a VSTA issue for Infopath 2013, so I moved the post to MSDN Visual Studio Tools for Applications (VSTA) forum for more effective responses.

    Thanks for your understanding.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 17, 2014 10:12 AM
  • Thanks for the reply George,

    I had tried the "What's New ..." link before but found nothing relating to this issue.

    Hopefully I'll get some responses from the VSTA forum.


    Friday, January 17, 2014 3:55 PM
  • Does anyone monitor this forum? Can anyone help with my question please?
    Wednesday, January 22, 2014 1:57 PM
  • Did you ever find a solution to this problem?

    Kind regards.

    Tuesday, September 16, 2014 12:05 PM