cannot update while running on a read-only volume. the application is on a read-only volume. please move the application and try again. if you’re on macos sierra or later, you’ll need to move the application out of the downloads directory. this might mean the application was put on quarantine by macos.

Are you having trouble in visual studio code for checking Updates in Macbook?

Solution 1:

Is the app still in the Downloads folder? If so, try moving it to the Applications folder and see if that fixes it. If that doesn’t work, then try below solution.

Solution 2:

If that doesn’t work, then try running the following commands in Terminal:

1.Open a Terminal in Mac by going to Applications folder >> Utilities folder >> Terminal.

2.Paste the below line in terminal

sudo chown $USER ~/Library/Caches/*

3. It will ask for password >> Enter Password (Password will be hidden in terminal)

4. Click Return

5.Paste below line of code in to terminal and Click Return.

xattr -dr /Applications/Visual\ Studio\

6. Open Visual studio code again and Check for Updates.


Different ways for Getting Refresh Token:

1.Manually enter Client Id and Client secret in Input field.
Every Time user has to Manually Generate RefreshToken

2.Using Custom Label or Custom settings.
when the client Id/secret is placed in custom label, client Id/secret is not editable while Installing as managed package .
when the client Id/secret is placed in Custom settings, client Id/secret is editable while Installing as managed package.


The use case is to generate Refresh token manually inorder to track who is asking for Refresh Token and when the data comes in to salesforce,so inorder track all this information refresh token is generated manually.

In This Example I have used Input field to manually enter Client Id and Client Secret to get the Refresh Token.

ClientIdConsumer Key from Connected Apps.

ClientSecret- Consumer Secret from Connected Apps.


<apex:page controller="RefreshTokenClass" >
<apex:slds />
<apex:form >
<div class="slds-form slds-form_stacked">
<div class="slds-form-element slds-size_2-of-4">
<label class="slds-form-element__label" for="input-id-01"><b>Client Id</b></label>
<div class="slds-form-element__control">
<apex:inputText id="clienti" styleClass="slds-input" value="{!clientid}"/>
<div class="slds-form-element slds-size_2-of-4">
<label class="slds-form-element__label" for="input-id-01"><b>Client Secret</b></label>
<div class="slds-form-element__control">
<apex:inputText id="clientsecr" styleclass="slds-input" value="{!clientsecret}" />
<apex:commandButton action="{!auth_step_1}" value="Step1:Get Authorization Code"/>&nbsp;
<apex:commandButton action="{!auth_step_2}" value="Step2:Get RefreshToken"/>
<div style="display:{!IF($CurrentPage.parameters.code != Null && str = Null ,'block','none')}">
<label><b>Authorization Code:</b></label>
<div class="slds-page-header slds-p-top_medium">
<div style="display:{!IF(str = Null, 'none','block')}">
<label><b>Refresh Token:</b></label>
<div class="slds-page-header slds-p-top_medium" style="display:{!IF(str = Null,'none','block')}">



public class RefreshTokenClass {
private auth_response rt;
public string str {get; set;}
public string clientid {get; set;}
public string clientsecret {get; set;}
public pagereference auth_Step_1(){
String auth_url = '';
String params =
'?response_type=code' +
'&client_id=' + encodingUtil.urlencode(clientid,'UTF-8') +
pageReference pr = New PageReference(auth_url + params);
return pr.setRedirect(false);
public pagereference auth_Step_2(){
HttpRequest req = new HttpRequest();
Http http = new Http();
String auth_url = '';
String params =
'?code=' + apexPages.currentPage().getParameters().get('code') +
'&grant_type=authorization_code' +
'&client_id=' + encodingUtil.urlencode(clientid,'UTF-8') +
'&client_secret='+ clientsecret +
req.setEndpoint(auth_url + params);
HTTPResponse resp = http.send(req);
rt = (auth_response)json.deserialize(resp.getBody(),auth_response.class);
system.debug('rt>>>>'+ rt );
str = rt.refresh_token;
return null ;
private class auth_response{
public string refresh_token;
public string access_token;

Lets Learn Together!!!

Lightning Record Edit Form in Lightning web component

How lightning record edit form can help your business and developer…


Get Account details by clicking new button and the page which have been opened should have some limited amount of fields how business needed and it should have Cancel, save and save & New button.

Record has to be saved without apex controller and need to redirect respected record page if the record got saved or if there is error it should show error message and withstand in same page.

2.Save & New:
Assume if you click Save & New button, it should save the record and it should show success Notification & reset page with empty field values.

if you click new button from Related list, then it should redirect to previous record page or if you click new button from List view, then it should redirect to List View.

Lets do this πŸ™‚


<lightning-record-edit-form object-api-name='Account' onsuccess={handleSuccess}
onerror={handleError} >
<header class="slds-modal__header">
<div class="slds-text-heading_medium slds-modal__title slds-hyphenate">New Account Details</div>
<div class="slds-page-header">
<div class="slds-page-header__row">
Account Detail
<div class="slds-grid slds-gutters">
<div class="slds-col slds-size_1-of-12">
<div class="slds-col slds-size_5-of-12">
<lightning-input-field field-name="Name"></lightning-input-field>
<lightning-input-field field-name="Customer_Name__c"></lightning-input-field>
<lightning-input-field field-name="Opportunity__c"></lightning-input-field>
<lightning-input-field field-name="TaxCode3__c"></lightning-input-field>
<div class="slds-col slds-size_5-of-12">
<lightning-input-field field-name="CopyAccountValues__c"></lightning-input-field>
<lightning-input-field field-name="TaxCode1__c"></lightning-input-field>
<lightning-input-field field-name="TaxCode2__c"></lightning-input-field>
<div class="slds-col slds-size_1-of-12">
<div class="slds-m-top_large slds-grid slds-grid_align-center slds-align–absolute-center">
<lightning-button variant="brand" label="Cancel" type="cancel" onclick={handleCancel}></lightning-button>
<lightning-button type="submit" variant="brand" label="Save"></lightning-button>
<lightning-button type="submit" variant="brand" label="Save & New" onclick={saveAndNewClick}></lightning-button>


import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LightningRecordEditForm extends NavigationMixin (LightningElement) {
redirect = true;
resetpage = false;
handleSuccess(event) {
const even = new ShowToastEvent({
title: 'Success!',
message: 'Record created!',
variant: 'success'
if(this.redirect == true){
let creditnoteId =;
type: 'standard__recordPage',
attributes: {
if(this.resetpage== true){
const evt = new ShowToastEvent({
title: 'Error!',
message: event.detail.detail,
variant: 'error',
saveAndNewClick() {
this.redirect = false;
this.resetpage = true;
handleReset() {
const inputFields = this.template.querySelectorAll(
if (inputFields) {
inputFields.forEach(field => {
var url = window.location.href;
var value = url.substr(0,url.lastIndexOf('/') + 1);
return false;

In the above HTML code, there are two parameters onsuccess and onerror which work as similar as standard controller in visualforce page for saving record and throwing error details before saving record.

When we click Save&New standard save functionality should work, but it shouldn’t redirect to any page, instead it should withstand in same page and clear the field values. so we have a parameter (this.redirect = false;) to stop the redirection to record page or list page.

There is one more parameter to handle the reset, only when we click save & New (this.resetpage = true;)

Let’s Learn Together!!!

Cancel in Lightning web component

When you develop Lightning web components, while clicking cancel it has to take you back to the previous page,but in lightning there is no direct way to go back to previous page.

Assume there is a New Button which is available in parent object Record page and the same button is available in Related list,In both scenarios it has to navigate different pages.but as of now in salesforce there is no parameter to hold the previous page data, so we are now directly hard coding in js file to navigate to record page or List page like below,

type: “standard__objectPage”,
attributes: {
objectApiName: ‘c2g__codaCreditNote__c’,
actionName: ‘list’
state: {
filterName: ‘Recent’

But above code will not work in all scenarios, because the button is in various locations and previous page differs, so below code is alternative way to overcome to navigate to previous page

<lightning-button variant=”brand” label=”Cancel” type=”cancel” onclick={handleCancel}/>

var url = window.location.href;
var value = url.substr(0,url.lastIndexOf(‘/’) + 1);
return false;

This code will work for all scenarios for Cancel button.

Learning Never Ends!!!

URL Hack Pre-populate field with default values in Lightning Experience

From Spring’20, When you click on button, you can navigate to a Record’s Create Page with Default Field Values. After clicking Save or Quick save be patient for few seconds and refresh the page using Ctrl + F5.


For navigating pass return url parameters as Record Id, like this

or like this,

Example of a Contact ID (003D0000001aH2A)

Object ID Prefix

Place the Object Id prefix in return URL.

Filter reports via url parameters in lightning experience

I had an issue after refreshing sandbox my reports were not working correctly.I was able to get all values in URL but it was not passing to report Filter values…

Classic URL:


After Refreshing your sandbox make sure filter in report doesn’t have Is Locked Equal to True.