Why this function doesn't work?

G

Gabriele Fabbri

I would like to make a script that output a field value with an ALERT
method.
Why this function doesn't work?
I think my mistake is about the "path" of the field but I can't
understand how can I refer corectly to that field...

function msoxd__attivita_tempo_ded_attr::OnBeforeChange(eventObj)
{
XDocument.UI.Alert(XDocument.DOM.documentElement.selectSingleNode("myFields:d.attivita/myFields:eek:ra_inizio"));
}

Many thanks,
Gabriele Fabbri.
 
G

Gabriele Fabbri

virgul said:
I don't really understand what you want to do with our function???

I want catch the field value and print it in an alert popup... I need to
know how catch it correctly because I have to work with my fields
values, make operations etc...

Gabriele Fabbri.
 
V

virgul

It's more simple to add a conditionnal formating to the fields who are
false and after do a:

UI.Alert("The value of ", mychamp1, "and", mychamp2 , "are not
correct")

but this syntax send you the name of the field not is value.
 
G

Gabriele Fabbri

virgul said:
It's more simple to add a conditionnal formating to the fields who are
false and after do a:

UI.Alert("The value of ", mychamp1, "and", mychamp2 , "are not
correct")

but this syntax send you the name of the field not is value.

Yes... but I need to get the value of the field, I have towork on the value.

Thanks anyway,
Gabriele Fabbri.
 
V

virgul

So a conditonnal formating like a underscore or a red text box don't
interest you! you wan't a message box like:


Your entry is incorrect:
mychamp1 : 32
mychamp2 : 43


It is what you want?
 
V

virgul

I it is what you want you can do that:


IXMLDOMNode titi=
thisXDocument.DOM.selectSingleNod("my:myFields/my:employee");
thisXDocument.UI.Alert(titi.text);

Is that OK?

++
 
G

Gabriele Fabbri

virgul said:
I it is what you want you can do that:


IXMLDOMNode titi=
thisXDocument.DOM.selectSingleNod("my:myFields/my:employee");
thisXDocument.UI.Alert(titi.text);

Is that OK?

++

Yes, I'm trying something similar now, but it returns me always "null".
Have to check.
Thank you.

Gabriele Fabbri.
 
G

Gabriele Fabbri

Mh, now my code is:

function msoxd__attivita_tempo_ded_attr::OnBeforeChange(eventObj)
{
var oMyNode = XDocument.DOM.selectSingleNode("my:myFields/my:descrizione");
XDocument.UI.Alert("Value: " + oMyNode.text);
}

When I start the module it display me thi error: "Object needed".
Where is my mistake?
 
V

virgul

you can't define define a var for what you put IXMLDOMNode!!!!
and please not + but , !!!!!!!

that work
 
G

Gabriele Fabbri

virgul said:
you can't define define a var for what you put IXMLDOMNode!!!!
and please not + but , !!!!!!!

that work

function msoxd__attivita_tempo_ded_attr::OnBeforeChange(eventObj)
{
IXMLDOMNode oMyNode =
thisXDocument.DOM.selectSingleNode("/my:myFields/my:descrizione");
thisXDocument.UI.Alert("Value: " + oMyNode.text);
}

DOESN'T WORK, but hey... don't get upset, I'm a noobie with InfoPath.
You are not forced to answer me, I appreciate your patience.

Thank you,
Gabriele Fabbri.
 
V

virgul

ok no probleme I say not + but ,!!
It's for this ligne

thisXDocument.UI.Alert("Value: " + oMyNode.text);

So the corret syntax is:

thisXDocument.UI.Alert("Value: " , oMyNode.text);
that's the base of the programation !!!!

Ok have a nice day!!!

++
 

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