/*
|
* Author: Yanan Chen
|
* Created Date: 03/02/2022
|
* Purpose: Utility class for describe layouts
|
* Test Class: NewAndEditLoanerApplicationDetailController
|
* History:
|
* 03/15/2022 - Yanan Chen - Initial Code.
|
*
|
* */
|
global class NewAndEditLoanerAppDetailController extends NewAndEditBaseController {
|
public NewAndEditLoanerAppDetailController (ApexPages.StandardController controller){
|
List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('loaner_application_detail__c').getDescribe().fields.getMap().keyset());
|
// Add fields to controller. This is to avoid the SOQL error in visualforce page
|
if(!Test.isRunningTest()){
|
controller.addFields(fieldList); // contact lookup
|
}
|
Init(controller.getRecord());
|
SObject obj = controller.getRecord();
|
if(obj.Id == null){
|
//初始化加载值
|
obj.put('OwnerId',UserInfo.getUserId());
|
}
|
}
|
|
|
@RemoteAction
|
global static Response saveLoanerApplicationDetail(String sobJson, String transId, Boolean isNew){
|
system.debug('JSON Payload:' + sobJson);
|
return save(new loaner_application_detail__c(), sobJson, transId, isNew);
|
}
|
}
|