Is there a way to develope custom functions?

F

Fred

I can attach a function to an element to get the default value, and
this value is recaluclated if change happend to other element.
Basically, it is like cell in excel with a formular.

Rule is different concept, rule is attached to an element, when change
is made to that element , rule is evaluated, the action can be set a
field to a calculated value.

So if a element depends on 3 element, it is better to use default
calculated value than attached the same rule to 3 dependant element.

The problem is that the fomular that can be used in calculated value
is limited to standard xpath function, while rule is more powerful( if
condition, then action), it can not be used as calucalted function. So
is there a way to extend the function I can use in infopath?

If there is no, it would be good feature in next version of infopath.
 
G

Greg Collins

What you are trying to accompish means using code. With code you can do all
of this and more without the limitations of XPath. I recommend managed code
over script.
 
F

Fred

What you are trying to accompish means using code. With code you can do all
of this and more without the limitations of XPath. I recommend managed code
over script.

--
Greg Collins
Microsoft MVP
Visit Braintrove athttp://www.braintrove.com
Visit InfoPathDev athttp://www.infopathdev.com

Yes, that is what I am doing right now. The thinks is you still need
to attached the code to afterchanged event handler of all of the
depended elements, which is not very elegant.

Fred
 
G

Greg Collins

You can create an OnAfterChange event for an ancestor element. The event
bubbles up the DOM. You can find out what the actual node was. If you wanted
to you could create a single OnAfterChange event handler on the root node
and get all changes to that event handler.
 

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