Extensibility Events
365 business Address Validation publishes one event another extension can subscribe to. It decides whether the address prediction runs for a table the app does not know.
| Codeunit | Event | Raised |
|---|---|---|
bdev.Address Prediction API (5523621) | OnIsAddressPredictionEnabledForTableNo | When a page activates the prediction control for a table the app does not support itself. |
Why there is only one
The app publishes further events, but they sit on codeunits marked Access = Internal and cannot be reached from another extension. What they offer is available in a supported form elsewhere: to validate a record of your own, call the Address Validation API rather than waiting for the app to come to you.
OnIsAddressPredictionEnabledForTableNo - Event
The event is raised for every table except the ones the app supports itself - Contact, Customer, Vendor, Employee, Resource, Sales Header and Ship-to Address, each of which has its own switch in Address Validation Setup. Subscribe to it to switch the type-ahead on for a table of your own.
It is only reached when address prediction is enabled in the setup at all and the feature is licensed. A subscriber answering true therefore enables the prediction for your table, but does not turn the feature on.
Code
| Parameter | Type | Description |
|---|---|---|
tableNo | Integer | The table id the page passed to OnControlAddInReady. |
enabled | Boolean | Set to true to run the prediction for this table. |
Example
Code
Only ever switch it on
Several extensions can subscribe to this event, and they see each other's answer. Set enabled := true for the tables that are yours, and leave the parameter alone for every other table id - enabled := (tableNo = Database::Broker) would switch off the prediction another extension had just enabled.
Without a subscriber that answers true, the prediction control on a page of your own loads but never offers a suggestion. That is the usual explanation for a type-ahead that stays silent.


