I have been struggling a bit on a little project I’m doing here in Epicor.
I have a dashboard showing all sorts of customer information (also information from UD fields via normal BAQ’s and data in custom tables through External BAQ’s). The dashboard allows you to search on a customer and see if it is still valid for orders (based on a date calculated in one of the External BAQ’s).
I have no problem showing the data on the dashboard or using conditional formatting to color a column red when the date is in the past, but is there any way to have a message box pop up when you search on a customer and the customer is not valid for orders?
So in summary: Is it possible to show a message box when opening or reloading a dashboard?
First off, make sure your dashboard is deployed. This will allow script editor customization by launching the compiled dashboard in developer mode.
Once you are in the script editor, you can add an on form load event using the customization wizard. This event can contain a call to show a message box.
There are two main approaches I might use for this problem:
A. Write a BAQ returning all customer IDs that are valid for orders. You can either make an EpiCombo and bind this datasource so that users can only select valid customers, or you can execute code OnLeave of the textbox to clear the textbox and display the popup if the BAQ returns no records. In this case you would execute the BAQ using the dynamicquery adapter, passing in a parameter from the form for the customer id (there are a number of ways to accomplish this).
B. There are a variety of places in a compiled dashboard where you can add custom logic. One such area from your question would be aftertoolclick. You can add an event for the aftertoolclick event where the tool called is equal to the refresh button. Here, you can conditionally display a message box if the row count in the EpiUltraGrid is 0. Depending on what you’re using it for in the end, you may need to store a variable in the aftertoolclick method and check for the variable and reset it in another method that is called immediately after the data loads. This type of implementation can be tricky.
Let me know if this makes sense or if you have any additional questions.