Updating the format of a merge field
Submitted by Guest on Wed, 24/02/2016 - 04:05
What is the process for either requesting an update to the format of a merge field or requesting that a new field be created?
In the US, the proper format for an address is:
City, State Zip
What OPEN kicks out is:
City State Zip (no comma)
Since I suspect that this is set up to be common format in Australia, is it possible to create four new merge fields for street address, city, state and zip so we can format addresses properly for here in the US?
Thanks, Alan
Re: Updating the format of a merge field
Alan - can you confirm that you are referring to the family of party:getxxxxxAddress() functions.
I can see two ways to achieve what you want:
1) [as you suggest] providing functions that get the parts of the address; and
2) provide an address formatting facility
I suspect that the second is the better approach because it gets past the problem of providing address component functions for each of the address types (ie correspondence, billing, reminder, practice, etc). It would also 'fix' the display on the Customers|Information screen which displays the description - which is derived from the expression "concat(party:getBillingAddress(.),' - ',party:getHomeTelephone(.))"
There is already support in messages.properties for different decimal, time, date etc formats. It would be logical to add an address format facility that would achieve what you want.
Something along the lines of
address.format address city state code
or in your case:
address.format address city, state code
Note that https://www.informatica.com/au/products/data-quality/data-as-a-service/a... suggests that the proper US format is to omit the comma.
Commas aside, the above website makes it clear that there are also international variations on the ordering of the address components - for example Germany uses
address code city (with no state).
Tim A - I suspect that we need to add this to the list of internationalisation support improvements.
Regards, Tim G
Re: Updating the format of a merge field
So I now know more about this topic than I ever planned...
Per the US Postal Service, they prefer to have addresses written in all caps and with no punctuation at all because it is easier for their machines to read. To the rest of us, this looks awkward. If I was sending a birthday card to my mom, her address would read:
Mom Bern
7811 Street Address
Houston, TX 77063
Yes, I am working with [party:getBilling Address(party:getPatientReferralVetPractice(.))] and [party:getBillingAddress(party:getPatientOwner(.))]
Re: Updating the format of a merge field
For tracking purposes, I've raised this as https://openvpms.atlassian.net/browse/OVPMS-1723
Note that the changes outlined wouldn't support uppercasing, but you can do this already in jasperreports, with $F{fieldName}.toUpperCase().
I imagine it works in jxpath as well.