To facilitate data entry, the Excel App provides lookups and data assistance. Date fields provide a date picker, enumeration (enum) fields provide an enum list, and relationships provide a relationship lookup. When relationships exist between entities, a relationship lookup is shown. We can create custom lookups to show data options when an enum or relationship isn't sufficient. The main use case is when data must be retrieved from an external service and presented in real time.
In this recipe, we will show how to add a custom lookup on currency code on a vendor's entity.
Carry out the following steps in order to complete this recipe:
- Open the previously created project in Visual Studio.
- Open the Designer View for
VendVendorEntity
. Right-click onMethods
and then click onNew Method
. - Add the
lookup_CurrencyCode
method from the following code sample:
[SysODataActionAttribute("VendVendorEntityCustomLookup", false), //Name in $metadata...