email envelope problem (data validation) - InfoPath Dev
in

InfoPath Dev

email envelope problem (data validation)

Last post 12-13-2007 09:52 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-13-2007 07:54 AM

    email envelope problem (data validation)

    I have a form with a button which is supposed to 1)submit the form to a database and 2) send the form via an email data connection to selected email addresses. My problem is I get an error saying that an object is expected. The error highlights line 77 as the issue. I look at the debugger and can't figure out the issue. I have elements titled 'my:EmailedTo' and 'my:Title' added to my main DOM. Can someone look at the code below and advise what the problem is?

    function CTRL196_4::OnClick(eventObj)

    {

    createEmail();

    }

     

     

    function createEmail()

    {

    var xmlContributors = XDocument.DOM.selectNodes("dfs:myFields/my:EmailedTo");

    var xmlContributor;

    var xmlTitle = XDocument.DOM.selectSingleNode("dfs:myFields/my:Title");

    var rgRecipients = new Array();

    while (xmlContributor = xmlContributors.nextNode())

    rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("dfs:myFields/my:EmailedTo")));

    try

    {

    var oEnvelope = XDocument.View.Window.MailEnvelope;

    oEnvelope.Subject = getNodeValue(xmlTitle);

    oEnvelope.Visible = true;

    }

    catch (ex)

    {

    XDocument.UI.Alert(ex.description);

    }

    }

     

    Thanks.

    Heath

  • 12-13-2007 09:52 AM In reply to

    Re: email envelope problem (data validation)

    One problem you have is in your push() statement. You are doing a selectSingleNode() when you don't need to because it is already being done by nextNode().

    var xmlContributors = XDocument.DOM.selectNodes("dfs:myFields/my:EmailedTo");
    var xmlContributor;
    var rgRecipients = new Array();
    while (xmlContributor = xmlContributors.nextNode())
    rgRecipients.push(getNodeValue(xmlContributor));

     

    I don't know if that's the problem you are experiencing... but it was certainly a problem.

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