Factboxes are more then ever a powerfull way for presenting related information. Normally you link your Factbox through properties, but now and then you need to do this from code.
This works fine if your page has at least one record, because the filtering is set on the “OnAfterCurrRecord” trigger of the page. So when there is no records, no filter is set on you factbox and then all related records are shown.
And that is not the meaning.
So what can you do to avoid this annoying behavior?
I figured out a way.
Just to make my factbox look empty, I place the following code on the “OnFindRecord” trigger of the factbox.
The system will check if there are filters and if there are none I raise an empty error. But because I put the ASSERTERROR before it, the system will not show the error and my factbox is empty as you can see.
It is not rocket science but maybe helpfull to make you solution look nice in every situation.