CustomLabel is available in Tooling API and can be used to get all CustomLabel Information. With single callout, REST API return 2000 records and then provide "nextRecordsUrl" attribute which contain URI for next set of custom label.
If you want to create class in your org and execute it methods to get custom label information, then refer below URL:
Custom Label : Fetch all Custom Label Information using Tooling API
But if you don't want to deploy new class to production or any org to get custom label information, then you can run below apex script in execute anonymous window in developer console to get custom label information.
Hope this will help!!!
If you want to create class in your org and execute it methods to get custom label information, then refer below URL:
Custom Label : Fetch all Custom Label Information using Tooling API
But if you don't want to deploy new class to production or any org to get custom label information, then you can run below apex script in execute anonymous window in developer console to get custom label information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string finalCSVString ='Id,Name,Value\n'; | |
findAllCustomLabels(''); | |
public static void findAllCustomLabels(string endpointURL){ | |
if(endpointURL=='' || endpointURL==null){ | |
endpointURL='/services/data/v45.0/tooling/query/?q=Select+id,Name,Value+from+CustomLabel'; | |
} | |
HttpRequest req = new HttpRequest(); | |
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID()); | |
req.setHeader('Content-Type', 'application/json'); | |
String domainUrl=URL.getSalesforceBaseUrl().toExternalForm(); | |
system.debug('********domainUrl:'+domainUrl); | |
req.setEndpoint(domainUrl+endpointURL); | |
req.setMethod('GET'); | |
Http h = new Http(); | |
HttpResponse res = h.send(req); | |
string responseBody = res.getBody(); | |
system.debug('****responseBody:'+responseBody); | |
JSONParser parser = JSON.createParser(responseBody ); | |
string cname,cvalue,cid; | |
boolean isMoreRecordsAvailable; | |
string nextEndPointUrl; | |
while (parser.nextToken() != null) { | |
if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){ | |
String fieldName = parser.getText(); | |
parser.nextToken(); | |
if(fieldName == 'done') { | |
isMoreRecordsAvailable=parser.getBooleanValue(); | |
}if(fieldName == 'nextRecordsUrl') { | |
nextEndPointUrl=parser.getText(); | |
}if(fieldName == 'Id') { | |
cid=parser.getText(); | |
}if(fieldName == 'Name') { | |
cname=parser.getText(); | |
}if(fieldName == 'Value') { | |
cvalue=parser.getText(); | |
finalCSVString = finalCSVString + cid+','+cname.escapeCsv()+','+cvalue.escapeCsv()+'\n'; | |
} | |
} | |
} | |
responseBody=null; | |
res=null; | |
system.debug('****Total Allowed Callout Limits-'+Limits.getLimitCallouts()); | |
system.debug('****No.of callout performed-'+Limits.getCallouts()); | |
system.debug('****Heap size used-'+Limits.getHeapSize()); | |
if(!isMoreRecordsAvailable){ | |
//add this condition if getting heap size error--6000000 heap size . | |
//&& (Limits.getLimitHeapSize()-Limits.getHeapSize()>100000) | |
if(Limits.getLimitCallouts()-Limits.getCallouts()>0 ){ | |
findAllCustomLabels(nextEndPointUrl); | |
} | |
}else{ | |
List<string> toAddresses= new List<string>(); | |
toAddresses.add(UserInfo.getUserEmail()); | |
sendEmail(finalCSVString,'All Custom Labels.csv','Custom Label Information through Developer console','Please find attached file for your reference',toAddresses); | |
} | |
} | |
public static void sendEmail(string csvString, string csvFileName,string emailSubject,string emailBody, List<string> toAddresses){ | |
Messaging.EmailFileAttachment csvAtt = new Messaging.EmailFileAttachment(); | |
blob csvBlob = Blob.valueOf(csvString); | |
string csvname= csvFileName; | |
csvAtt.setFileName(csvFileName); | |
csvAtt.setBody(csvBlob); | |
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
if(toAddresses.size()==0){ | |
string currentUserEmailId = UserInfo.getUserEmail(); | |
toAddresses.add(currentUserEmailId); | |
}if(emailBody=='' || emailBody==null){ | |
emailBody = 'Please find attached file for your reference.' ; | |
} | |
mail.setToAddresses(toAddresses); | |
mail.setSubject(emailSubject); | |
mail.setPlainTextBody(emailBody); | |
mail.setHtmlBody(emailBody); | |
mail.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAtt}); | |
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); | |
} | |
Contact Quickbooks Technical Support Number 800-901-6679 to acquire instant solution of your issues & queries. Get round the clock assistance from our highly skilled technicians. Whenever appear with technical issues then make a call on the support anytime.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteQuickBooks Support Phone Number
ReplyDeleteQuickbooks Proadvisor Support Phone Number
QuickBooks Helpline Number
This is an amazing blog, thank you so much for sharing such valuable information with us.
ReplyDeleteVisit for best website design and SEO services at- Website Development Company in India
best website design services in gurgaon
best web design company in gurgaon
best website design in gurgaon
website design services in gurgaon
website design service in gurgaon
best website designing company in gurgaon
website designing services in gurgaon
web design company in gurgaon
best website designing company in india
top website designing company in india
best web design company in gurgaon
best web designing services in gurgaon
best web design services in gurgaon
website designing in gurgaon
website designing company in gurgaon
website design in gurgaon
graphic designing company in gurgaon
website company in gurgaon
website design company in gurgaon
web design services in gurgaon
best website design company in gurgaon
website company in gurgaon
Website design Company in gurgaon
best website designing services in gurgaon
best web design in gurgaon
website designing company in gurgaon
website development company in gurgaon
web development company in gurgaon
website design company
website designing services
Web and Pro Infomedia is Best Digital Marketing Agency in Lucknow
ReplyDeleteA very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Custom food labels
ReplyDeleteA very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. erinnerung
ReplyDeleteI am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. create photo with text
ReplyDeletePretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. www.excellentcustomclothing.com
ReplyDelete