Looping issue when entering layout
I have a dashboard layout that have:
- global filed displaying the total number of records in a date range.
In order to calculate the total number of records in a daterange, I have created a script that:
- Go to SampleRecord table Layout
- Perform find in a daterange
- Set global field with get(FoundCount)
- Go back to dashboard layout
Now, when I apply this script in a layout setup with script trigger, as soon as I enter the dashboard layout, the script start looping.
What would be the best solution not to loop?