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
Datetime.valueOfGmt(String.valueOf(Datetime.now())); |
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
function getSfSessionStorage() { | |
let sfSessionStorage = {}; | |
// find the sessionStorage key that hold the SF data | |
Object.keys(sessionStorage).forEach((key) => { | |
if (key.includes('namespace')) { | |
sfSessionStorage = JSON.parse(sessionStorage[key]); | |
} | |
}); |
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
List<PicklistEntry> fields = Account.SObjectType.getDescribe().fields.getMap().get('Type').getDescribe().getPicklistValues(); | |
for (PicklistEntry picklistEntry : fields) { | |
System.debug(picklistEntry.getLabel() + ' with value: ' + picklistEntry.getValue()); | |
} |
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
[ | |
{ | |
"code": "PUB", | |
"label": "Australian Public Company" | |
}, | |
{ | |
"code": "PRV", | |
"label": "Australian Private Company" | |
}, | |
{ |
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
document.querySelectorAll('*').forEach(el => el.contentEditable = 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
mysql -u username -p database_name < file.sql |
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
List<Network> communities = [ SELECT Id, Name, UrlPathPrefix, Status FROM Network ]; | |
for (Network community : communities) { | |
System.debug(community.Name + ': ' + community); | |
} | |
// or via Connect API | |
List<ConnectApi.Community> communitiesConnect = ConnectApi.Communities.getCommunities().communities; | |
for ( ConnectApi.Community community : communitiesConnect) { |
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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "SFDX: Deploy Current File", | |
"type": "shell", | |
"command": "sf", | |
"args": [ | |
"project", | |
"deploy", |
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
{ | |
"search.exclude": { | |
"**/.localdevserver": true, | |
"**/.sfdx": true, | |
"**/node_modules": true, | |
"force-app\\main\\default\\aura": false, | |
"force-app\\main\\default\\classes": false, | |
"force-app\\main\\default\\lwc": false, | |
"force-app\\main\\default\\pages": false, | |
"force-app\\main\\default\\staticresources": 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
/** | |
* @description Inverse the Object keys/values | |
* @param {object} obj | |
*/ | |
export function inverseObjectKeysAndValues(obj: { [key: string]: any }) { | |
return Object.keys(obj).reduce( | |
(acc, curr) => ({ | |
...acc, | |
[obj[curr].toString()]: curr, | |
}), |