Expression-Fields: How to call a user defined function?

Expression-Fields: How to call a user defined function?

Inside a Expression Field I would like to call a function I defined. Like this:

thisapp.mynamespace.myfunction(currentrecord)

My function is defined as:

string mynamespace.myfunction(MyRecord loc) {
    // do something
}

How do I addess the current record?
Or can I only adress the fields of the record and not the record itself?


Thanks for helpful answers

P.S.: Why I this tagged this as "problem" and not as "question"? Because this is not documented anywhere. I considder that a problem.