1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public with sharing class lexNewOnLineSurvey2Controller {
    public lexNewOnLineSurvey2Controller() {
        
    }
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new InitData();
        try {
            List<Contact> r= [SELECT CreatedById from Contact where id=:recordId];
            res.CreatedById=r.get(0).CreatedById;
        } catch (Exception e) {
            return res;
        }
        return res;
    }
    // @AuraEnabled
    // public static InitData initForNewOnLineSurveyButton(String recordId){
    //     InitData res = new InitData();
    //     try {
    //         Report__c re = [
    //             select
    //             Date__c,
    //             Practitioner1__c,
    //             OwnerId
    //             from Report__c where Id =: recordId
    //         ];
    //         res.ownerId = re.OwnerId;
    //         res.datec = re.Date__c;
    //         res.practitioner1 = re.Practitioner1__c;
    //     } catch (Exception e) {
    //         throw new AuraHandledException(e.getMessage());
    //     }
    //     return res;
    // }
    public class InitData{
        @AuraEnabled public String Name;
        @AuraEnabled public String CreatedByNameC;
        @AuraEnabled public String CreatedById;
    }
}