Hello, Javaniceday!

  • Mock node-fetch in node.js with different scenarios

    Mock node-fetch in node.js with different scenarios

    const getWithNodeFetch = async () => { const ops = { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'OAuth [some access token]' } }; const res = await fetch('https://example.com', ops); if(!res.ok) throw new Error(`error doing GET status code: ${res.status} status message ${res.statusText}`); return res.json(); } const getFileWithNodeFetch = async () => { const ops = Read more

  • Get Salesforce ContentVersion file info using node-fetch

    Get Salesforce ContentVersion file info using node-fetch

    Salesforce ContentVersion is a standard Salesforce object that represents a specific version of a file or document in Salesforce. It is used to store and manage various types of content, such as attachments, files, or document versions. Each ContentVersion record contains information about the file, including its title, file name, file extension, and other metadata. Read more

  • Salesforce CLI – SFDX – Cannot read properties of undefined (reading ‘id’)

    Salesforce CLI – SFDX – Cannot read properties of undefined (reading ‘id’)

    When running the command that makes the login against our Sandbox org, it redirects to a localhost URL and then it display an error that doesn’t give us so much information sfdx auth:web:login -a myuser@abc.com –instanceurl=https://xxxxx–xxxxx.my.salesforce.com The error Cannot read properties of undefined (reading ‘id’) This is most likely not an error with the Salesforce Read more

  • How to delay an execution in Salesforce Apex

    How to delay an execution in Salesforce Apex

    In Java, we can use Thread.sleep(1000) to delay the execution by one second. In Apex is not that easy since Salesforce is a multi-tenant environment. By Delaying the execution in the main thread we not only impact the users of our organization but also other Salesforce customers Read more

  • Webstorm does not have write access to /applications/webstorm.app/contents

    Open a terminal and just execute: sudo chmod -R 775 /Applications/WebStorm.app/Contents Close the window and check for updates again. The error should disappear and you should be able to update Webstorm Read more

  • First-time shipped implementation is like going into technical debt

    First-time shipped implementation is like going into technical debt

    As a starting point, we can say roughly that technical debt is all those decisions we make during software development that narrow down our capacity as a team to create new features that add value to the business. Read more