Skip to content

Instantly share code, notes, and snippets.

@johncasimiro
johncasimiro / Mimic SQL select * statement in SOQL using Apex
Created December 9, 2010 06:57
A code snippet that mimics the popular Select * SQL syntax in force.com's Apex language.
/*
* @description: A code snippet that mimics the popular Select * SQL syntax in force.com's Apex language.
*/
// Initialize setup variables
String objectName = 'Contact'; // modify as needed
String query = 'SELECT';
Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap();
// Grab the fields from the describe method and append them to the queryString one by one.
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@AltiusRupert
AltiusRupert / NamedCredential.cls
Last active July 5, 2024 09:24
Create Salesforce Named Credentials via Apex
// see https://salesforce.stackexchange.com/questions/165551/possible-to-update-namedcredential-from-apex
MetadataService.NamedCredential credential = new MetadataService.NamedCredential();
credential.fullName = 'Demo_Credential';
credential.label = 'Demo Credential';
credential.endpoint = 'https://www.DEMO2.com';
credential.principalType = 'NamedUser';
credential.protocol = 'NoAuthentication';
system.debug(createMetadata(credential));
@doppiomacchiatto
doppiomacchiatto / README.md
Created January 13, 2020 17:29
Salesforce DX steps, tips, and tricks

Initial Set-Up

Authenticate with Dev Hub (one time)

The Dev Hub is our production org. Scratch orgs are registered against a Dev Hub and can be managed from there. Execute the following command in a terminal (you'll be prompted to enter your username and password in a browser window):

  • sfdx force:auth:web:login --setdefaultdevhubusername -a Unum_DevHub

Set Your Default Dev Hub Username

It's possible to have multiple Dev Hub orgs. If you want to change to a different Dev Hub, you must specify your defaultdevhubusername setting with this command: