N
nick brandwood
Hi there,
I have a form with a field that concats lots of text together.
this field is contained within text boxes on three views of the form, and
each view needs a different function to make this concat.
I've tried using the famous 'fx' button however, this seems to set the
formula for the field, not the text-box, as such, when I change view and set
the formula for that view, it changes all three formulas.
So, I've tried to do this using script (the field is called "notes"):
public void OnSwitchView(DocEvent e)
{
// grab notes node
IXMLDOMNode nodeNote =
thisXDocument.DOM.selectSingleNode("/my:myFields/my:richiesta/my:note")
// look which form we are on, and set the default value formula
switch (thisXDocument.View.Name.ToString()) {
case "ferie":
thisXDocument.UI.Alert("ferie");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
case "permesso":
thisXDocument.UI.Alert("permesso");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
case "malattia":
thisXDocument.UI.Alert("malattia");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
default:
thisXDocument.UI.Alert("case crashed out.");
break;
}
nodeNote.something.somethingelse= strDefaultFormula
}
I am having difficulty finding which property of nodeNote I need to change.
As there doens't seem to be any reference to this on the web, perhaps it
can't be changed, and in that case, how do I do such a thing?
thanks again,
nick
I have a form with a field that concats lots of text together.
this field is contained within text boxes on three views of the form, and
each view needs a different function to make this concat.
I've tried using the famous 'fx' button however, this seems to set the
formula for the field, not the text-box, as such, when I change view and set
the formula for that view, it changes all three formulas.
So, I've tried to do this using script (the field is called "notes"):
public void OnSwitchView(DocEvent e)
{
// grab notes node
IXMLDOMNode nodeNote =
thisXDocument.DOM.selectSingleNode("/my:myFields/my:richiesta/my:note")
// look which form we are on, and set the default value formula
switch (thisXDocument.View.Name.ToString()) {
case "ferie":
thisXDocument.UI.Alert("ferie");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
case "permesso":
thisXDocument.UI.Alert("permesso");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
case "malattia":
thisXDocument.UI.Alert("malattia");
// set string for default formula
strDefaultFormula="concat("hello","world")
break;
default:
thisXDocument.UI.Alert("case crashed out.");
break;
}
nodeNote.something.somethingelse= strDefaultFormula
}
I am having difficulty finding which property of nodeNote I need to change.
As there doens't seem to be any reference to this on the web, perhaps it
can't be changed, and in that case, how do I do such a thing?
thanks again,
nick