function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kunal Purohit 4Kunal Purohit 4 

How to Resolve Dashboard Error?

Hello,
While validating Dashboard, I am getting error:
Must specify sortBy attribute to one dashboard table column.

How to Resolve the above error. I have checked with all the reports ascociated with dashboards for which above error is coming. There is already Sort by attribute in Report. 
SwethaSwetha (Salesforce Developers) 
HI Kunal,

As the error suggests, the only possibility of seeing this is when you have not added the required sortBy attribute. sortBy is mandatory for dashboard components of type Table and as such one needs to correct any components of this type to successfully deploy. Retrieving the metafile without that required attribute will cause failure

Please see Salesforce recommendations as per below articles.

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_dashboard.htm

https://help.salesforce.com/articleView?id=sf.dashboards_two_level_sorting.htm&type=5

Related: https://salesforce.stackexchange.com/questions/40601/error-while-deploying-dashboards

If this information helps, please mark the answer as best. Thank you