Introduction to Salesforce Scheduler
Set Up Salesforce Scheduler
Salesforce Scheduler Data Model Overview
Salesforce Scheduler Platform Events
Authenticate Salesforce Scheduler APIs
Translate SOQL Query Results
Previous Versions
To translate SOQL query results into the language of the user who submits the query, use the toLabel method. If no translation is available, the method returns the search results in the default language of the organization.
Any organization can use the toLabel() method. It’s useful for organizations that enabled the data translation. For information on how to enable data translation, see Manage Entities’ Data Translation in Salesforce Scheduler Help.
The toLabel method uses the following syntax:
1toLabel(object.field)This method is supported on the WorkTypeGroup, ServiceResource, and ServiceTerritory objects. Use this method to return translated search results on the following fields:
You can’t use the toLabel() method in the ORDER BY clause. For limitations that apply to the translation, see Translate Returned SOQL Results in SOQL and SOSL Reference.
Example of data translation request for WorkTypeGroup:
1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
2query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Details__c),+toLabel(Disclaimer__c)+From+WorkTypeGroupWhere YOUR_INSTANCE is a variable.
Example of data translation request for ServiceResource:
1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
2query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Profile_URL__c)+From+ServiceResourceWhere YOUR_INSTANCE is a variable.
Example of data translation request for ServiceTerritory:
1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
2query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Notes__c)+From+ServiceTerritoryWhere YOUR_INSTANCE is a variable.
Example of translated query results for WorkTypeGroup:
1{
2 "totalSize": 6,
3 "done": true,
4 "records": [
5 {
6 "attributes": {
7 "type": "WorkTypeGroup",
8 "url": "/services/data/v54.0/sobjects/WorkTypeGroup/0VSx00000000ZTDGA2"
9 },
10 "Name": "手術",
11 "Description": "説明",
12 "Details__c": "<ul><li><b><i><u>これはテキスト領域です</u></i></b><span style=\"color: rgb(0, 0, 0);\"></span></li></ul>",
13 "Disclaimer__c": "信頼"
14 },
15 {
16 "attributes": {
17 "type": "WorkTypeGroup",
18 "url": "/services/data/v54.0/sobjects/WorkTypeGroup/0VSx00000000ZTAGA2"
19 },
20 "Name": "WTG 3",
21 "Description": null,
22 "Details__c": null,
23 "Disclaimer__c": null
24 }
25 ]
26}Example of translated query results for ServiceResource:
1{
2 "totalSize": 2,
3 "done": true,
4 "records": [
5 {
6 "attributes": {
7 "type": "ServiceResource",
8 "url": "/services/data/v54.0/sobjects/ServiceResource/0Hnx000000003I6CAI"
9 },
10 "Name": "Адам Смит",
11 "Description": "описание",
12 "Profile_URL__c": "http:// профиль"
13 },
14 {
15 "attributes": {
16 "type": "ServiceResource",
17 "url": "/services/data/v54.0/sobjects/ServiceResource/0Hnx000000003I9CAI"
18 },
19 "Name": "Stacy Simon",
20 "Description": null,
21 "Profile_URL__c": null
22 }
23 ]
24}Example of translated query results for ServiceTerritory:
1{
2 "totalSize": 2,
3 "done": true,
4 "records": [
5 {
6 "attributes": {
7 "type": "ServiceTerritory",
8 "url": "/services/data/v54.0/sobjects/ServiceTerritory/0Hhx00000000c9tCAA"
9 },
10 "Name": "l'apollon",
11 "Description": "à la mode",
12 "Notes__c": "française"
13 },
14 {
15 "attributes": {
16 "type": "ServiceTerritory",
17 "url": "/services/data/v54.0/sobjects/ServiceTerritory/0Hhx00000000cgaCAA"
18 },
19 "Name": "tempST",
20 "Description": null,
21 "Notes__c": null
22 }
23 ]
24}