This file contains 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
HttpRequest req = new HttpRequest(); | |
Http http = new Http(); | |
//req.setheader('accept','application/json'); | |
//https://tonyren-my.sharepoint.com/_api/v1.0/me/files/016EQYPSSQZ3I757WQYVALBAADZKWLQDTI/children?expand=thumbnails | |
req.setEndpoint('callout:Office365NamedCredential2/drive/items/016EQYPSSQZ3I757WQYVALBAADZKWLQDTI/children/Ren.txt/content'); //me/drive/root/children' | |
req.setheader('accept','application/json'); | |
req.setHeader('Authorization', 'Bearer {!$Credential.OAuthToken}'); | |
req.setHeader('Content-Type', 'text/plain'); | |
String temp= 'data:text/plain;base64,QXBleCBDbGFzc2VzDQoJVW5wYWNrYWdlZA0KCQlBU0lfQ1JNX0NO…FTSV9DUk1fSlBfUmVkaXJlY3RfVGVzdA0KCQlBU0lfQ1JNX0pQX1Rlc3RDbGFzc0hlbHBlcg=='; |
This file contains 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
Rectypeid = Schema.SObjectType.Your_Object_API_Name.getRecordTypeInfosByName().get('Record Type').getRecordTypeId(); | |
List<Your_Object_API_Name> terms= [select ownerId,Email__c from Your_Object_API_Name where id in: SID]; // SID :set ID | |
List <String> ToAddresses = new List <String>(); | |
ID ownerid; // Get Owner ID | |
boolean Emailexist=false; | |
for(Your_Object_API_Name poi:terms){ | |
if(poi.Email__c!=null){ | |
ToAddresses.add(poi.Email__c); // Get Email address of Supplier | |
ownerid=poi.ownerId; | |
Emailexist=true; |
This file contains 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
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
string body = 'Hi '; | |
String[] toAddresses = new String[] {'sksworld10@gmail.com'}; | |
mail.setToAddresses(toAddresses); | |
mail.setSubject('Test Subject'); | |
mail.setSaveAsActivity(false); | |
for(OrgWideEmailAddress owa : [select id, Address, DisplayName from OrgWideEmailAddress]) | |
{ | |
if(owa.Address.contains('testuser')) | |
mail.setOrgWideEmailAddressId(owa.id); |
This file contains 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
ID userid = UserInfo.getUserId(); | |
User currentUser = [SELECT Id, Email FROM User WHERE Id =:userid]; | |
List <String> ToAddresses = new List <String>(); | |
ToAddresses.add('renchk@foxmail.com'); | |
String subject = 'Issue Log Notification Email'; | |
String body = 'Test' + '\n'; |
This file contains 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
Log__c log= new Log__c( name='log!'); | |
insert log; | |
Blob b = Blob.valueOf(body); | |
Attachment attach1= new Attachment(); | |
attach1.ParentId = log.id; | |
attach1.Name = 'log.txt'; | |
attach1.Body = b; | |
This file contains 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
var jsforce = require('jsforce'); | |
var conn = new jsforce.Connection({ | |
loginUrl: 'https://test.salesforce.com', //'https://login.salesforce.com', | |
version: '36.0' | |
}); | |
conn.login('youSFDC@Account', 'YourPassword', function(err, res) { | |
if (err) { | |
return console.error(err); |
This file contains 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
var jsforce = require('jsforce'); | |
var conn = new jsforce.Connection({ | |
loginUrl: 'https://test.salesforce.com' | |
}); | |
conn.login('YOURACCOUNT', 'YOURASSWORD', function(err, res) { | |
if (err) { | |
return console.error(err); | |
} |
This file contains 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
var jsforce = require('jsforce'); | |
var mkdirp = require('mkdirp'); | |
var conn = new jsforce.Connection({ | |
loginUrl: 'https://test.salesforce.com', // if the org is sandbox 'https://test.salesforce.com', if it is Production,please input https://login.salesforce.com' | |
version: '36.0' | |
}); | |
var currentdate = new Date(); | |
var datetime = 'YourProjectName_' + String(currentdate.getFullYear()) + String(currentdate.getMonth() + 1) + String(currentdate.getDate()) + '-' + String(currentdate.getHours()) + String(currentdate.getMinutes()) + String(currentdate.getSeconds()); |
This file contains 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
#!/bin/bash | |
<<'COMMENT' | |
run : bash Gitshell.sh | |
COMMENT | |
echo "~~~~~~~~~~~~~~~~~Fisrt, Clone your repository~~~~~~~~~~~~~~~~~~" | |
git clone https://username:Password@bitbucket.org/tonyrenhk/YourCodeRepository.git |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript"> | |
function hideReportCaption(){ | |
var htmlElements = document.getElementsByTagName('h2'); | |
for(var index=0; index<htmlElements.length; index++){ | |
if(htmlElements[index].innerHTML=='Report'){ | |
htmlElements[index].style.display='none'; | |
} | |
} |