lookup event |
You can use the lookup event to replace the default USoft lookup behavior by custom behavior, or to restrict the default behavior to cases in which some condition applies. The default lookup behavior is that when the user clicks a lookup button next to a foreign key field, the corresponding lookup page is displayed. This page allows him to select a value from the parent table. This default behavior is implemented by generating the .navigateToLookup() method of the UDB object. Example To restrict the lookup behavior to cases in which condition applies, follow these steps:
if ( condition ) $.udb.navigateToLookup("lookup page", { ... });
CAUTION: When USoft publishes runtime lookup behavior, it generates a lookup button and transfers the lookup behavior defined for the InputControl onto the 'onclick' event for that button. The lookup behavior you specify will only be transferred successfully if you script against Web Designer objects as explained in the steps of this help topic. The following attempt at a fully programmatic approach would be unsuccessful: $(".InputControl").on("lookup", function(evt, options) { if ( condition ) $.udb.navigateToLookup("lookup page", { ... }); });
See Also |