Use a field, based on Array Elements in Data Entity in D365FO
In D365FO, the field, based on array elements are rarely used. Because to use the field, based on array elements, we need a virtual field and handle it by using x++ code.
Here are the steps to show how to create and consume virtual field in D365FO.
- The field (Real) based on array elements
- Now create 3 Real unmapped Fields
- And set the names
- Set the Is Computed Field property to No
- In the ContractMasterDataEntity designer, right-click the Methods node, and then click Override > postLoad. Your X++ code in this method will generate the values for the virtual field.
- Paste the following X++ code in for the postLoad override. Notice that the postLoad method returns void.
Use virtual
fields to receive and parse fields
- In the designer for the ContractMasterDataEntity, right-click the Methods node, and then click Override > mapEntityToDataSource.
- Paste the following X++ code in for the
mapEntityToDataSource method.
- Compile your project.
Comments
Post a Comment