New answers tagged

4

Generic SObject and SObject[] are not yet supported at the interface between LWC and Flow (TLDR: You can't get there from here). We're working on it right now, though, and hope to get it into Summer '20. You can get an early taste for some of the experience by looking at how we implemented it for Apex Invocable Actions in Spring '20 We don't have any short-...


3

You can easily parse your String into Map and then serialize Map itself. Here is an example how to do it: String toMap = 'Profile:[UID=, crmId=0000o00002XXXXxXXX, email=top@top.com, firstname=null, lastname=test]'; Map<String, String> ans = new Map<String, String>(); String actualValues = toMap.substringAfter(':'); actualValues = actualValues....


0

I tried running the SOAP based Account query against my DEV org. To do this I imported the Enterprise WSDL as a Web Reference, rather than the newer default of a Service Reference. After importing the Enterprise WSDL I needed to update the generated Reference.cs proxy classes for public ListViewRecordColumn[][] records. See Importing the Salesforce Winter ...


3

An SObject by itself can be cast to EmailTemplate, however, Map cannot, that happens, because you may have not only EmailTemplate as values in Map, but also other SObjects. Example: Map<String, SObject> sobjectMap = new Map<String, SObject>(); sobjectMap.put('red', new Account(Name = '123')); sobjectMap.put('green', new Contact(LastName = '123')...


7

This is probably because the clas Name contains the definition of another inner class like this: public class name{ public class test{ } } If so, you have to specify the parent class name before referencing the test inner class. So if you want to make a list of records of type name.test, you have to use: List<name.test>


0

I finished working on something related to this recently. I wrote a small Apex Wrapper-ish class that will grab all the writeable fields for a declared SObjectType, and compare them with the already included values in our currently instantiated records list. (My utility doesn't query for additional field values, it just makes the existing records include all ...


7

You can use the generic sObject: void recordsByFieldToMap(Map<String, sObject> target, SObjectField field, sObject[] source) { for(sObject record: source) { target.put((String)record.get(field), record); } } It would be used like this: Map<String, License_Item__c> items = new Map<String, License_Item__c>(); recordsByFieldToMap(...


Top 50 recent answers are included