public with sharing class AccountUrlRecordTypeIdController {
|
@AuraEnabled
|
public static string CreateAccountGYN(){
|
return Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_Class_GYN').getRecordTypeId();
|
}
|
@AuraEnabled
|
public static string ReportId(String TypeName){
|
try {
|
String reportId = [select Id from Report where DeveloperName = :TypeName].Id;
|
return reportId;
|
} catch (Exception e) {
|
throw new AuraHandledException(e.getMessage());
|
}
|
}
|
@AuraEnabled
|
public static RepairContactData RepairContact(String recordId){
|
RepairContactData result = new RepairContactData();
|
try {
|
Account report = [select Department_Class_Label__c from Account where Id = :recordId];
|
result.departmentClassLabel = report.Department_Class_Label__c;
|
result.typeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('AgencyContact').getRecordTypeId();
|
} catch (Exception e) {
|
throw new AuraHandledException(e.getMessage());
|
}
|
return result;
|
}
|
public class RepairContactData{
|
@AuraEnabled
|
public string typeId;
|
@AuraEnabled
|
public string departmentClassLabel;
|
}
|
}
|