on 2018 Nov 18 12:38 PM
Hello All ,
Iam facing an issue that data mapper doesn't map the field i have just added ,
Steps i have done :-
1) i added erpCustomerCode attribute into AddressWsDTO
/** <i>Generated property</i> for <code>AddressWsDTO.erpCustomerCode</code> property defined at extension <code>myWebservices</code>. */
private String erpCustomerCode;
2)added the same attribute into addressData
/** <i>Generated property</i> for <code>AddressData.erpCustomerCode</code> property defined at extension <code>myFacades</code>. */
private String erpCustomerCode;
3) change the code inside the mapper
validate(address, "address", getAddressDTOValidator());
final AddressData addressData = getDataMapper().map(address, AddressData.class,
"erpCustomerCode,firstName,lastName,titleCode,line1,line2,town,postalCode,country(isocode),region(isocode),defaultAddress,phone");
addressData.setShippingAddress(true);
addressData.setVisibleInAddressBook(true);
final String erpCode = erpUserService.createErpUser(address);
**addressData.setErpCustomerCode(erpCode);**
getUserFacade().addAddress(addressData);
if (addressData.isDefaultAddress())
{
getUserFacade().setDefaultAddress(addressData);
}
return getDataMapper().map(addressData, AddressWsDTO.class, fields);
but i always get this response
{
"country": {
"isocode": "xx"
},
"defaultAddress": false,
"firstName": "xxxx",
"id": "xxxx",
"lastName": "xxxx",
"line1": "xx",
"line2": "",
"phone": "xxx",
"postalCode": "xxx",
"region": {
"isocode": "xxx"
},
"town": "xxx"
}
i have tried to debug but it gives no error in the mapping ,, any idea why my added field (erpCustomerCode) isn't added ?
Thank you.
Request clarification before answering.
Hi @Prihan - Instead of directly adding erpCustomerCode attribute into AddressWsDTO and AddressData, please try adding it to the beans.xml. You can refer https://help.hybris.com/1808/hcd/8bbdfe9286691014a741829ebffd8512.html and https://help.hybris.com/1808/hcd/e571a0e6f7524d4ab62e29cc2b387aeb.html to validate if you are missing some step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.