ERP 2.50:Developers Guide/Concepts/How to Migrate 2.50 Modules to 3.0 Advanced
This document is an Appendix for How to Migrate 2.50 Modules to 3.0 . Here will be covered border cases that are unlikely to happen. The purpose is not to pollute the former document with lots of details that in most of the cases are not applicable.
_R Fields in Selectors
Selectors in 2.50 WAD windows generate two fields, one for the actual value (ID of the referenced record) and another one (called like the former one appending _R) for the displayed value.
In 3.0 selectors the _R field is not generated. Usually this is not important because the actual value is maintained with the same name so processes can still retrieve it in the same way. But in case of processes getting the _R field it will not work see 16353 and 16342.
The solution for these cases is to obtain the actual value, and obtain identifier from that.
For example (see actual changeset), in a process to be invoked from a window that has a column named C_BPartner_ID with a selector reference, it was possible to get the partner's name as follows:
String bpName = vars.getRequestGlobalVariable("inpcBpartnerId_R", "");
This code must be migrated to get the business partner ID and obtain the name from that:
String bpID = vars.getRequestGlobalVariable("inpcBpartnerId", ""); BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, bpID); String bpName = bp == null ? "" : bp.getIdentifier();