Solved

"There is data related to this Metric. Please delete those first and then try again."

  • 19 April 2017
  • 3 replies
  • 42 views

Userlevel 3
Badge
How do I go about cleaning up unused scorecards? I am getting an error that says 



















"There is data related to this Metric. Please delete those first and then try again." but I don't see where to do so.
icon

Best answer by sai_ram 20 April 2017, 14:47

View original

3 replies

Userlevel 7
Badge +1
Hi ,



Steps to delete

Account Scorecard Metrics




Step 1: Create a report on “Scorecard Fact” Object and check

if there are records present in it.









Step 2: If records are present in the object, ensure that

you delete those records.









Step 3: Use the following script to delete the records from the

Scorecard Fact object.









Important Please

change the Metric name in the following script.









The following query will delete only 9999 records from Scorecard

Fact object. If your record size is more than the limit mentioned, please

execute the query multiple times.









List<JBCXM__ScorecardFact__c>

scfact = [SELECT id, JBCXM__MetricId__r.name FROM JBCXM__ScorecardFact__c Where

JBCXM__MetricId__r.name = 'Metric name' LIMIT

9999];









Delete

scfact;









Step 4: Delete the Metric that you used in the above script

only after the query is executed.



Thanks,



Sairam


Userlevel 3
Badge
That worked, thanks! For anyone else that runs into this, this article helped me as well. https://gainsight.zendesk.com/hc/en-us/articles/221536387-Scorecards-Overall-score-calculation-incor...
Userlevel 7
Badge +3
Hi Jason,



I noticed that the support article you linked to is from our old help center which is no longer being updated. Please see the new site: https://support.gainsight.com/Product_Documentation/Scorecards/Troubleshooting/Scorecards_Overall_sc...



Any article URL that contains "zendesk" is from our old site. But I'm glad you found the content helpful!

Reply