I want to be able to select Region while creating an address. I only select city of type City but all other fields are string or integer. I want to make Region and other fields available in creating the address. I can’t seem to figure out how to add the field to fields table ( MetaFields ) in address template lines.
What is the right way to add address fields available to address template lines ?
public class AddressMetaServiceImpl implements AddressMetaService {
@Override
public List<String> getAddressFormFieldsList() {
return List.of(
"department",
"subDepartment",
"buildingName",
"townName",
"townLocationName",
"districtName",
"countrySubDivision",
"room",
"floor",
"buildingNumber",
"streetName",
"postBox",
"city",
"zip");
}
So you need to add your « region » and other custom fields in this list and in your
\axelor-open-suite\axelor-base\src\main\resources\domains\Address.xml
Thank you. However, I don’t have experience in recompiling Java application. I do suppose gradle would be used.
In any case, I did resolve the issue by using Groovy templating. I was stupid to not understand that city information is more than enough to pull region, department, canton details. I used templating language like :