public with sharing class NewAgencyContractController {
|
|
@AuraEnabled
|
public static UserResult UserInfo_Owner() {
|
UserResult result = new UserResult();
|
ID myUserID = UserInfo.getUserId();
|
Profile p = [select Id,Name from Profile where id =:System.Label.ProfileId_SystemAdmin];
|
try {
|
User tempUser = [select Id,Name,ProfileId from user where id = : myUserID ];
|
result.id = tempUser.Name;
|
result.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('AgencyContract').getRecordTypeId();
|
result.profileId = p.Name;
|
} catch (exception e) {
|
result.result = e.getMessage();
|
}
|
return result;
|
}
|
|
public class UserResult {
|
@AuraEnabled
|
public string result;
|
public UserResult( ) {
|
result = 'Success';
|
}
|
@AuraEnabled
|
public string id;
|
@AuraEnabled
|
public String recordTypeId;
|
@AuraEnabled
|
public string profileId;
|
}
|
}
|