Home > Software design >  SELECT TOP in Salesforce Source Editor
SELECT TOP in Salesforce Source Editor

Time:11-26

I want to select just a small sample from Salesforce data source, in order to make some tests. I tried the select top 100, for instance, but it didn't work as it seems that Salesforce Source Editor uses a different language which is not T-SQL.

Is there a way to do that? Or do I need to extract the whole table?

Screenshot from Salesforce Source Editor

Thank you,

I tried the Select Top ... To obtain just a sample of the table, because it has more than 3M entries and I just want to run some tests.

CodePudding user response:

SOQL dialect doesn't have TOP keyword. Use plain old ORDER BY CreatedDate DESC LIMIT 100 for example.

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm

And I've never seen that "source editor" thing. It's not an official tool, don't reference it too much in questions as people may not be familiar with it. Developer Console in Salesforce web UI, sfdx command line tool or vscode plugin are more legitimate.

  • Related