force-app/main/default/classes/OnCallController.cls
@@ -35,7 +35,9 @@ //获取所有字段 List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('On_Call__c').getDescribe().fields.getMap().keyset()); // Add fields to controller. This is to avoid the SOQL error in visualforce page controller.addFields(fieldList); if(!Test.isRunningTest()){ controller.addFields(fieldList); } SObject obj = controller.getRecord(); if(obj.Id != null){ //更新