With the Metric Details window, a user can select which metrics they want to add to their Home Page. You will want any metrics you create to be listed in this window. To make your metrics available for selection, you must register a procedure trigger for the LoadAvailableMetrics procedure of the syHomePageMain form. The following is a portion of the Startup script for the sample integrating application. It registers a procedure trigger that will make the metrics available in the Metric Details window.
l_result = Trigger_RegisterProcedure(script LoadAvailableMetrics of form syHomePageMain, TRIGGER_AFTER_ORIGINAL, script IG_HomePage_LoadAvailableMetrics); if l_result <> SY_NOERR then warning "Procedure trigger registration failed."; end if;
The trigger processing procedure that runs in response to trigger must do the following:
The following is the trigger processing procedure that makes the “Top 5 Leads” metric available in the Metric Details window. The metric list uses the list view control, so ListView functions are used to add the item. Notice how two additional subitems are added to the list view to keep track of the product ID and metric ID.
local boolean bAccess; local long nItemIndex; local string sName; { Top 5 Leads } call MetricHasAccess, bAccess, METRIC_TOP5LEADS, IG_PROD_ID; if bAccess then call MetricGetName, sName, METRIC_TOP5LEADS, IG_PROD_ID; if empty(sName)= false then if not ExistsforMetricID('User ID' of globals, METRIC_TOP5LEADS, IG_PROD_ID) of form syHomePageMetric then nItemIndex = ListView_ItemAdd('(L) AvailableMetrics' of window MetricCustomize of form syHomePageMain, sName, 0); ListView_ItemSetIntSubitem('(L) AvailableMetrics' of window MetricCustomize of form syHomePageMain, nItemIndex, COL_DICTID of form syHomePageMain, IG_PROD_ID); ListView_ItemSetIntSubitem('(L) AvailableMetrics' of window MetricCustomize of form syHomePageMain, nItemIndex, COL_METRICID of form syHomePageMain, METRIC_TOP5LEADS); end if; end if; end if;