Wednesday, November 18, 2020

Heroku deploy button error

Trying to: 

Get a Heroku deploy button to work in Github Readme

Error:

Clicking on the button results in

"No app.json located in the repo URL provided. Make sure that an app.json file exists in the project root directory"

Fix:

Wait some time and refresh the Github repo browser tab. I'm not sure why but this seems to fix things up.

Wednesday, July 3, 2019

Salesforce Unrestricted Picklists and Inactive Values

File this under Esoteric:

Any new values entered into an unrestricted picklist field will cause new inactive picklist values to be created.

The only documentation I could find:

When inserting an unrestricted picklist field that does not have a PicklistEntry, the system creates an “inactive” picklist value. This value can be promoted to an “active” picklist value by adding the picklist value in the Salesforce user interface.

When creating new, inactive picklists, the API checks to see if there is a match. This check is case-insensitive.

Tuesday, May 21, 2019

Developer Console query not working

Symptom


Error when running a query from the Developer Console: Sobject type 'ObjectName' is not supported

Cause


Tooling API checkbox is checked!

Resolution


Uncheck the check box.

Wednesday, March 27, 2019

Salesforce Full Copy Sandbox Redirects to Production After Refresh

Symptom


One of the following may occur in a full copy sandbox shortly after it's been refreshed from production:

  • The url changes to production
  • "Insufficient privileges" message appears
  • "Could not reach [production url]" message appears

Possible Cause

The Salesforce Console remembers the user's tabs so they are retained between sessions.

When a full copy sandbox is refreshed, the user tabs are copied from production.

When these tabs display, the page attempts to redirect to production to display the records associated with the saved tabs.

Resolution

Close all the console user tabs.

Thursday, May 31, 2018

Compile errors due to custom classes with the same names as standard objects

Symptom


Trigger or class won't compile with error "Variable does not exist: Name", where "Name" is a field on a standard object such as Account. 

e.g.

trigger myAccountTrigger on Account (before insert) {
    for(Account a:Trigger.New){
        system.debug(a.Name);
    }
}

Cause


There is a custom class with the same name as the standard object, the trigger is referring to this class and the specified attribute doesn't exist on the custom class.

e.g.

public class Account {
    //test class to object conflict
}



Resolution

The thing is, we don't want our code to refer to the class - we want it to refer to the standard object.

Obviously if we knew this problem was going to come up we would never have named the class "Account" in the first place. But after the fact it could be a lot of work to change the class name (and all references to it) to something like "AccountClass".

The easy way to achieve this is by fully qualifying the references to the standard object. This is done by prefixing the object name with "Schema." No need to change the class!

e.g.

trigger myAccountTrigger on Schema.Account (before insert) {
    for(Schema.Account a:Trigger.New){
        system.debug(a.Name);
    }
}

Monday, April 23, 2018

Notepad++ Search Results pane goes awol

Symptom

Search Results pane disappears and won't come back no matter how many times you press F7


Resolution

remove %appdata%\Notepad++ folder

Cause

Notepad++ had a spaz.

Reference


https://stackoverflow.com/questions/46632070/notepad-search-window-disappeared

Monday, May 22, 2017

Finding good standard external id fields

In a previous post I mentioned that you can spot the really good external id standard fields in workbench because they have idlookup=true and unique=true.

In workbench, select your standard object and use the Expand All button, then search for unique: true