Posts

Showing posts with the label country

Adding address for Organization

Image
1.Adding Address List<ListType> addressTypes = ListTypeServiceUtil.getListTypes(Organization.class.getName()+ ListTypeConstants.ADDRESS); Here retrieving the all the address for the organization. Below screen is the available address for the organization. ( 1.Billing, 2.Other, 3.P.O.Box, 4.Shipping ) .Hence " addressTypes " contains all these address As an example we will add address as "Billing" type. so we will iterate all for the listtypes to get Billing type. for (ListType addressType : addressTypes) { String addressTypeName = addressType.getName(); if(addressTypeName.equalsIgnoreCase("Billing")) { personalAddressTypeId = addressType.getListTypeId(); } } Then adding the adddress AddressLocalServiceUtil.addAddress(userId, Organization.class.getName(), organization.getOrganizationId(), street1, street2, street3, city, zip,regionId, countryId, personalAddressTypeId, true, true); Here we need to add the country and region also,...