Why doesn't this work?? (Alert box)

D

djohnson

Hello, I am accustomed to using VS with autocomplete, so it is
different for me using IP typing jscript blindly. Anyway this problem
is somewhat frustrating. I'm wondering why the alert line below
continually produces the error "Object doesn't support this property or
method."

I'm using the format:

XDocument.UI.alert("Message");

Isn't that correct?


Full code below is attached to a button:

function CTRL103_2::OnClick(eventObj)
{
var dom = XDocument.DOM;
var objEmail;
var blanks;
blanks=0;
if(dom.selectSingleNode("//my:filledBy").text=="") blanks=1;
if(dom.selectSingleNode("//my:firstName").text=="") blanks=1;
if(dom.selectSingleNode("//my:lastName").text=="") blanks=1;
if(blanks==0)
{
objEmail = Application.ActiveWindow.MailEnvelope;
//objEmail.To = ("//my:Requestors").text;
objEmail.To = dom.selectSingleNode("//my:Requestors").text;
objEmail.Subject = "Add/Remove User Request Form";
objEmail.Visible = true;
}
else
{
XDocument.UI.alert("Please fill in all require fields..");
}
}
 
S

S.Y.M. Wong-A-Ton

Case-sensitivity. Try this

XDocument.UI.Alert("Message");

Just a tip: If you install the InfoPath Toolkit for VS you can write code in
C# using Intellisense in VS and then convert your code to JScript when you
are done. The syntax calling properties and methods of objects used in
InfoPath doesn't differ much between the two languages.
 
D

djohnson

Oops. Sorry, I don't normally use JScript... mistakenly thought it
wasn't case senstitive. Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top