Schedule view expression to get customer last name

[I feel embarrassed to have to ask this - I should know how to do it.]

Currently I am using openvpms:get(.,'customer.name') to get the customer name - this returns lastName,firstName.  I would like to grab just the last name.  However openvpms:get(.,'customer.lastName') does not seem to work.

What should I be using?

Regards, Tim G

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Schedule view expression to get customer last name

The set of values available to schedule view expressions are simple values rather than instances of archetypes, so the usual rules don't apply.

You'll need to go via the customer.objectReference key e.g.:

 concat(openvpms:get(.,'customer.objectReference.firstName'), ' ', 
       openvpms:get(.,'customer.objectReference.lastName'))

Note that this may impact performance, as it has to read in the customer twice to perform the above operation. The performance implications are the main reason this is not provided as a field in the expression editor.

For a list of the available keys, see the ScheduleEvent class.

-Tim A

Syndicate content