Skip to content

Instantly share code, notes, and snippets.

View matt-newell's full-sized avatar

Matt Newell matt-newell

  • Chattanooga, TN
View GitHub Profile
@matt-newell
matt-newell / SassMeister-input-HTML.html
Created February 5, 2016 20:11
Generated by SassMeister.com.
<div class="foo">Allo Allo</div>o
@matt-newell
matt-newell / services.js
Created April 4, 2019 14:15
Dynamic sObject LWC
const ACCOUNT_FIELDS = [
'Account.Name',
'Account.LastModifiedDate'
];
const ACCOUNT_OPTIONAL_FIELDS = [
];
const CONTACT_FIELDS = [
'Contact.Name',
@matt-newell
matt-newell / README.md
Last active June 28, 2019 16:08
Validate Visualforce domain is ready

VALIDATE VISUALFORCE DOMAIN IS READY

Have you ever created a new scratch org with sfdx but seem to have trouble access visualforce pages? This seems to be a know issue and can take 0-18 minutes before the org is fully operational. This random delay can cause havoc on e2e/integration testing as well as unit test. So after many attempts to fix or delay CI/CD I believe I have finally found a solution.

First let's talk about the actual issue, spinning up a new scratch org. After running sfdx force:org:create you will receive a success message along with login/password info for your org. The core sfdc features of the org are almost ready instantly but if you have a managed package with namespace it takes 0-18 minutes. Navigating to one of these pages(vf pages) will not error with a 404 nor will they timeout. However it will load a blank screen so let's dig in a bit 😺

@matt-newell
matt-newell / index.js
Last active February 16, 2022 20:28
sfdc-bulk-read
#!/usr/bin/env node
//console.log('v1', process.argv, process.cwd(), process.env);
const jsforce = require('jsforce');
const sfbulk = require('node-sf-bulk2');
const util = require('util');
const fs = require('fs');
const fsPromises = require('fs').promises
const CFonts = require('cfonts')
@matt-newell
matt-newell / index.js
Last active February 14, 2022 14:59
sfdc-bulk-upsert
#!/usr/bin/env node
const jsforce = require('jsforce');
const sfbulk = require('node-sf-bulk2');
const util = require('util');
const fs = require('fs');
const fsPromises = require('fs').promises;
const path = require('path');
const CFonts = require('cfonts')
#!/usr/bin/env node
const jsforce = require('jsforce');
function main(){
try {
var conn = new jsforce.Connection({
loginUrl : 'https://test.salesforce.com'
});
conn.login(process.env.username, process.env.password, function(err, userInfo) {