31

The Seven Dwarfs live in the platform code. You should never see DOPEY, SLEEPY, DOC, GRUMPY, SNEEZY, BASHFUL, or HAPPY, but occasionally they break out and appear to a user. If you spot one of them, you need to contact support so they can be put back in their dwarfy walled garden.


18

You can't hop more than one data type per cast; each additional conversion requires another cast. For example, the following works: Integer i = (Integer)5.2; But you can't write: Object o = 5.2; Integer i = (Integer)o; And you also can't write: Integer i = (Integer)(Object)5.2; Basically, casting a Decimal from an Object reference to an Integer ...


15

I think I've figured it out. In java, the hashCode for an enum is not consistent across different executions. My Map is being initialized in the Batchable start() (with Database.Stateful). Then I try to access the map in Batchable execute(). Behind the scenes, salesforce must be running start() & execute() in separate java executions. This means ...


12

My Result and Possible "Fix". The above code works fine in my org (na11), i get "listviewable": null in my JSON, as well as lookupLayoutable which is also not documetned. I'm executing it from Execute Annoynmous. As a possible "fix" (see below for my thoughts on more durable solution), it maybe sensitive to API version of your calling Apex class, so check ...


10

Found this interesting statement in the idea Need a reliable developer script exception alert mechanism: Salesforce R&D has acknowledged the issue but states it is a feature frozen area therefore, there is no known issue is being worked on. R&D is planning to replace this feature with full-featured exception handling/notification/management system. ...


10

Currently no. The issue is that the body attribute for buttonMenu is of type Aura.ComponentDefRef[] vs the usual Aura.Component[] Because of that, items passed to v.body are expected to be templates to create components vs actual components. So you can't dynamically create the menuItem instances. If you explain more why you want to do that, I could ...


8

While it's not clear why that doesn't already work, to get your code out the door, my suggestion is to build your own REST dispatching service. The following pseudo code implementation works as followed: Register for all REST requests for a particular url (e.g. /teams/*) Register different controllers (which implement the interface Dispatchable) In case the ...


8

Not sure this is worthy of an answer, but too much to put as a comment. The only time I have seen anything remotely similar was with this and I was able to prove to support that a job had run and created duplicates. The info I got back from Tier 3 at the time: As we discussed, during the execution, an internal server error on the asynchronous process for ...


8

Seems I got some attention after submitting a case or this post or whatever, just got this notification: A bit late but at least I know the cause On March 16, 2017, Salesforce identified a misconfiguration in our test environment that allowed Apex callouts and outbound messages to reach endpoints outside of the test environment. At the same time, ...


8

After all this debugging, it appears to be a bug in the framework. Essentially, what's happening is that by the time the menu gets around to rendering the body in changeVisibility, the attribute componentDef on $A.createComponent(s) created lightning:menuItem components happens to be undefined instead of being markup://lightning:menuItem. This ultimately ...


7

I have seen similar behavior before. I've also run into two related issues when running self-scheduling jobs that run a lot: the "scheduled job" list gets really long even though most jobs in the list have run already a job in State "DELETED" still holds references to the classes, leading to the dreaded "Schedulable class has jobs pending or in progress" ...


7

I've hit a large number of bytecode caching issues related to managed packages in the last year - in many cases they can be resolved by using the Setup > Develop > Apex Classes > Compile all classes link. This forces a recompile of all your existing apex, which should clear out any invalid cached copies. Unless you have too many apex classes in your org, in ...


7

This was intentionally designed this way, and reason for that is an edge case. You can still change the value, you simply need to clear the reference before setting it first. ({ changeValue: function(cmp, evt, helper) { cmp.clearReference("v.value"); cmp.set("v.value", 10); }, }) Lets tell a little bit of a story here to explain ...


7

I've reproduced the problem with setting the OpportunityLineItem.Quantity to zero. As you would expect, there is a field integrity exception: Quantity (quantity must be nonzero) message added to the page automatically. I also got the unexpected Dwarf details added to the page messages. It appears the additional validation message is coming from the ...


7

The LWC lifecycle hooks are simply methods from the LightningElement which can be implemented at any level within the LWC inheritance hierarchy. It happens that the lightning-datatable itself makes use of the connectedCallback to perform necessary setup, including wiring up the row action handling. If you override such a method in an LWC that is itself ...


6

Ralph -- here is a possible explanation based on a similar experience I had: If you are generating a SOQL Select in class A using Schema.Describe to get all fields from CustomObject__c resulting in: Select field1__c, field2__c, field3__c, stdFieldA, stdFieldB from CustomOBject__c Yet, when this query was executed by class B, you get error System....


6

Contrary to other posts, it is absolutely possible to use email alerts with Sites users. In my case it was an object level permissions issues. Unlike apex, for an email template to be available, the running user needs access to the object being used for the email content (at least for visualforce email templates). If a field isn't accessible it just doesn't ...


6

This is subtle... If I write an object to implement the ShopBackend interface, there's no requirement that this object chooses the same parameter names as the interface. It only has to match the signature in terms of types and order. So, I can quite happily write public class ShopFoo implements ShopBackend { public void initialize() { } public ...


5

It seems that the variables declared with blank values do not really contain zero-length strings as intended. Consider the following Visualforce page: <apex:page> <apex:variable var="blank" value="" /> <p><apex:outputText value="NOT TRIMMED: {!ISBLANK(blank)}" /></p> <p><apex:outputText value="TRIMMED: {!...


5

As per the above suggestion, you will likely need to manage some of the routing yourself, however we can use regex to make this a simple process. Below is some example code I have tested in the workbench: @RestResource(urlMapping='/teams/*/members/*') global with sharing class TeamMemberService { @HttpGet global static String doGet() { Pattern ...


5

Each Apex transaction has a Maximum execution time of 10 minutes which is distinct from the Maximum CPU time per transaction on the Salesforce servers of 10,000 milliseconds for synchronous code and 60,000 milliseconds for asynchronous code. The 10 minute time limit exists to help prevent a thread from "hogging" server resources because the of the below ...


5

See What are the differences between the different possible jobs processed in the 'AsyncApexJob' object? for more information on jobs, but specifically they cover ApexToken: An 'ApexToken' job is used for Flex Queue enabled organizations. From Winter '16 onwards, the flex queue is enabled by default for all organizations. If an Apex code block invokes ...


5

I didn't even open a Salesforce ticket for this one, just observed that to avoid this Salesforce internal platform bug I can pass my model as JSON string var action = component.get( "c.saveModel" ); action.setParam( "jsonModel", JSON.stringify( component.get("v.model") ) ); action.setCallback(this, function(response) {}); and to change my Apex ...


5

Please refer the Salesforce Spring ’17 Release Notes, this was implemented to enhance security of the platform. Updated Referer Header When loading assets outside of Salesforce, or navigating outside of Salesforce, the referer header shows only salesforce.com rather than the entire URL. This feature eliminates the potential for a referer header to reveal ...


5

Your setup definitely can run future methods, so they are not ignored entirely. This test passes for me on cs14 using any API Version between 35 and 40: @IsTest public class DemoFuture { @TestSetup static void setupData() { createSomeData(); } @future public static void createSomeData() { SObjectFactory.create(...


5

Maximum length of text encrypted field is 175. Salesforce just shows incorrect error message you can read it here Are limited to 175 characters because of the encryption algorithm.


5

I've been playing around and it seems that its a bit buggy. From my point of view, it doesn't like to get the body rendered dynamically while updating the currentStep. The following code is a work-around that works, in case no-one else give another idea... Component <aura:attribute name="stage" type="Map" default="{id:'id2', label:'Label 2'}" /> <...


5

In Salesforce My_Field__c we create field with Number actually stores the decimal type values even if we define decimal places as 0. It is never be an Integer until we transform the value explicitly from Decimal to Integer. Decimal myDec = (Decimal) mySObject.get('My_Field__c'); So, then from this Decimal we can transform to Integer. Also, refer Rules of ...


5

Map and Set are internally based on HashMap and HashSet, respectively. In these classes, there are "buckets" created for each hashCode, and within each bucket, you have a list of values that each have the same hashCode but where equals return false. For performance reasons, these buckets are only calculated when calling add or addAll. Altering the ...


4

I suspect you are dealing with a Timezone Daylight Savings Time transition in the (GMT-07:00) Pacific Daylight Time (America/Tijuana) Timezone (Pacific) that occurs in that date range. On Sunday the 2nd of November they will transition from PDT to PST. Source So they will go from UTC-7h to UTC-8h. The DateTime.month() and format() for DateTime will be ...


Only top voted, non community-wiki answers of a minimum length are eligible