Is there a way to call the OnClicked of a button, from within the OnFieldChanged of other inputs?
Or to possibly make a “global” function, that can be called from an inputs events?
Background: I have a button to “re-calc” the part number and description (which has a very lengthy expression), when clicked.
I’d like that to happen every time any input is changed.
I could put that expression in the On Field Changed for every control, but that ends up being a pain to maintain, as any changes to the expression require updating every single input.
You can make the function it’s own method and just call the method whenever you want to do the calculation.
private void yourmethodhere(some parameters if you want)
{
do stuff here
}
Then whenever you want to call it, just use
yourmethodhere();
If you look at this old thread about writing CSV’s you can see the method addDataToCSV that is called from other places in the code. Then you can use it whenever you want, but only have to maintain it in one place.