Pre-populating the email "Introduction" field - InfoPath Dev
in

InfoPath Dev

Pre-populating the email "Introduction" field

Last post 12-03-2007 08:16 AM by nukkumatti. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-29-2007 04:13 PM

    • shmoss
    • Not Ranked
    • Joined on 11-29-2007
    • Posts 2

    Pre-populating the email "Introduction" field

    I'm trying to pre-populate the email "Introduction" field with text but keep getting an error - Object doesn't support this property or method" Below is the code I'm using. Any help would be great!!! Thanks, much!

     function XDocument::OnSubmitRequest(eventObj)

    var intro = XDocument.DOM.selectSingleNode("/my:myFields/my:FormInfo/my:FormIntro").text;

    oEnvelope.Introduction = intro;

    *****Below is complete function for reference******

    function XDocument::OnSubmitRequest(eventObj)
    {
     // If the submit operation is successful, set
     // eventObj.ReturnStatus = true;
     // Write your code here
     
     // var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
     var send_email = XDocument.DOM.selectSingleNode("/my:myFields/my:FormInfo/my:FormEmail").text;
     var submitter_email = XDocument.DOM.selectSingleNode("/my:myFields/my:Email").text;
     var intro = XDocument.DOM.selectSingleNode("/my:myFields/my:FormInfo/my:FormIntro").text;
    // var vp_email = XDocument.DOM.selectSingleNode("/my:myFields/my:VPemail").text;
     var subj = XDocument.DOM.selectSingleNode("/my:myFields/my:FormInfo/my:FormSubject").text;
     
    try
      {
      var oEnvelope = XDocument.View.Window.MailEnvelope;
      oEnvelope.To = send_email;
      //oEnvelope.CC = XDocument.DOM.selectSingleNode("/iss:myField/iss::Email");
      oEnvelope.CC = submitter_email;
      oEnvelope.Subject = subj;
      oEnvelope.Introduction = intro;
      oEnvelope.Visible = true;
      }
     catch (ex)
      {
      XDocument.UI.Alert(ex.description);
      }

      
    //   eventObj.ReturnStatus = true;
     
    }

     

    Filed under: ,
  • 12-03-2007 12:48 AM In reply to

    Re: Pre-populating the email "Introduction" field

    I don't know from where you got this but I am pretty sure that there is not such property "Introduction" for the mail envelope object. (please have a look in the help of your script editor). there is something existing for the eMail data adapter though. hope this helps.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 12-03-2007 06:48 AM In reply to

    • shmoss
    • Not Ranked
    • Joined on 11-29-2007
    • Posts 2

    Re: Pre-populating the email "Introduction" field

    Nukkumatti, thanks for the info. Based on my current code how would I write in an eMail data adapter that you mention?

  • 12-03-2007 08:16 AM In reply to

    Re: Pre-populating the email "Introduction" field

    first you need to set up a data connection to submit data as an eMail. tools - data connection - add... then you need to write your function which will call this data connection via code. just do a search and use dataAdabters as the phrase. if i remember correct i just answered the same question a few days ago.
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.