New answers tagged

0

Yes, you can. There are 2 ways you can go about it. One option is to mark your wrapper class properties as @AuraEnabled and make them public. public class Wrapper { @AuraEnabled public String objectLabel; @AuraEnabled public String id; @AuraEnabled public String subject; @AuraEnabled public DateTime createDate; } You can ...


3

If you want one generic put method to work, you basically have two options. The first would be to tuck your attributes in a Map. public class MyWrapper { public Map<String, Object> attributes; public MyWrapper put(String key, Object value) { attributes.put(key, value); return this; } } The other approach would be to use ...


1

In your test class you should set the current page via Test.setCurrentPage(page) method. Then you can add to the page the id of the record you're using in your test. Replace DokuBox_6 D6 = new DokuBox_6(); with: PageReference dokuboxPage = Page.DokuBoxPage; // Assuming that the VF Page name is DokuBoxPage Test.setCurrentPage(dokuboxPage); ApexPages....


2

You're passing oName to the wrapper constructor, but you are not storing it, so it will be lost. Moreover there is no oName field on Task, Event and ContentDocumentLink, that's why it doesn't compile due to "Variable does not exist" error. If you define the properties you need in your wrapper class, instead of relying on SObjects, you can remove ...


1

You already have one list, so the place more development work is likely is in your Wrapper class. For example: public class Wrapper implements Comparable { public Task at {get; set;} public Event be {get; set;} public Note cn {get; set;} public wrapper(Task a) { at = a; } public wrapper(Event b) { be = b; } ...


1

To have multiple SObject types in one list, you need to use list of sobjects. List<SObject> s = new List<SObject>{ new Event(), new Task(), new Note() };


1

The wrapper class that you define will vary and depend on what you wish to achieve. However, a common structure that most wrapper classes will follow is as below. public class OuterClass{ //OuterClassName properties... // use { get;set; } if you want to access the properties on VF public String property1; public Integer property2; ...


2

The deserialization needs to know what concrete type to use and that is signalled by an attributes field: "records":[{"attributes": {"type": "fund__c"}, "Name":"Fund1", ... so if the system that generates the JSON can provide that, get it added. Or if the records are always fund__c: public List<...


Top 50 recent answers are included