23

SFDC R&D has confirmed a bug in recalculateFormulas method . As of 0900h Pacific 2015-12-09, Known Issue not yet created. From Support: For now as a work around we would request you not select any lookup fields in the SOQL query when using the recalculateFormulas() From R&D: This issue happens if there are fields which are not updatable in ...


11

System.UnexpectedException gets thrown a lot with Note inserts if you do not prepare the content exactly right, and they cannot be caught or handled in any way. I wrote an open source package a while ago to abstract over some of these issues. From its documentation, a summary of the requirements: The following steps are required to prepare note content for ...


5

Fixed using this approach. In Java script Callback, var actSave = component.get("c.saveDataDML"); actSave.setParams({ "listToSaveString": JSON.stringify(itemList) }); and in Apex Controller, Deserialized an casted as below. @AuraEnabled public static List<Wrapperclass> saveDataDML(String listToSaveString){ List<...


4

You haven't provided much in the way of details here, but I'd suspect that your issue is with the date you're trying to set to Date_of_Visit__c I know that SOQL queries can handle date literals, but I don't think that the rest of Apex at large can. You should create an instance of the Date class using something like Date.valueOf(), and set your Date field ...


3

Instead counter use b.size() for(integer i = 0; i <b.size(); i++) { Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment(); efa.setFileName('attachment.pdf'); efa.setBody(b[i]); lstFileAttachments.add(efa); }


2

Initialize the ProdIds before it use.It will work fine.


2

If you are getting an error when sorting the List<SObject>, you may want to implement the Comparable interface on your wrapper class and sort your wrappers instead. It is not immediately clear based on your OP why you need to sort these things at all, so removing the sort call may be a more appropriate (and certainly simpler) course of action. If you ...


2

Unlike inline SOQL, dynamic SOQL can’t use bind variable fields in the query string. In doing so will result in a Variable does not exist error. Exactly what you are seeing. Problem: :portalUserInfo.conAccount.Id Solution: Resolve the variable field into an Id and use the id in your dynamic SOQL query. Id conAccountId = portalUserInfo.conAccount.Id; ...


2

Platform events in test class are unitested differently. Instead of EventBus.publish(exev); you have to use Test.getEventBus().deliver(); Test.startTest(); // Create test events // ... // Publish test events with EventBus.publish() // ... // Deliver test events Test.getEventBus().deliver(); // Perform validation // ... Test.stopTest(); Make sure you ...


2

I ran into the same issue seems to be related to having a subclass DatabaseAsyncTest.ClassUnderTest that implements Database.Batchable (DatabaseAsync). If you create DatabaseAsyncTest.ClassUnderTest in it's own class (e.g. DatabaseAsyncMock), everything should be fine.


2

You can get around these errors by creating a clone of the object, without the system fields in memory, and calling the function on the copy. See this example: // Starting Record Account a = [SELECT Id, Name, CreatedDate, IsDeleted FROM Account LIMIT 1]; // Copy of starting record - without system fields Account b = new Account ( Id = a.Id, Name ...


2

Still interested in an answer to question 1. Assuming the answer to question 2 is "yes" I've come up with the following for my case - FYI for anyone looking for an answer to the follow up question of "how". I am using CKEditor to produce HTML that I want to save in a Content Note. There appears to be no reason to escape all the XML and based on a dozen or ...


1

Presuming you can't somehow avoid an exception (e.g. NullPointerException is almost always avoidable), you would want to wrap your code in code like this: public ... someVFAction() { Savepoint sp = Database.setSavepoint(); try { // your code here // } catch(Exception e) { ApexPages.addMessages(e); Database.rollback(sp); } } Make sure ...


1

I had a similar issue and resolved it with V43.0 This works fine // Given a list of Platform Events of various types Sobject[] platEvents = new List<Sobject> { new Foo__e(), new Bar__e() }; // When submitted to the EventBus 1x1 Test.startTest(); for (Sobject platEvent : platEvents) { EventBus.publish(platEvent); Test....


1

Hi @pasan Eeriyagama i got reply from Salesforce. They have appiled a Patch and problem is resolved. So pages are working on Summer 17 preview.


1

Found below and it's fixed now, When binding dynamic input fields to page block you can't use hard binding with '.', instead better to go with below solution. The way I had used to bind the SObject, input_field.expressions.value = '{!FormObject.' + fld.getFieldPath() +'}'; Alternative way used to fix it, input_field.expressions.value = '{...


1

You can't cast decimals to integers. While I'm not able to replicate that exact error, I managed to get its close cousin: System.TypeException: Invalid conversion from runtime type Decimal to Integer Here's the code I wrote to generate the error. Decimal a = 123123234.12321321321; Object b = a; Integer c = (Integer)b; You'll have to convert the Decimal ...


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