public with sharing class LexInventoryHeaderClearStatusController { @AuraEnabled public static List init(String recordId){ List inventoryList = new List([SELECT Id, Name, Inventory_Status__c FROM Inventory_Header__c WHERE Id = :recordId OR Fixture_Header__c = :recordId]); return inventoryList; } @AuraEnabled public static String updateStatus(List inventoryList){ List tempList = new List(); try { for(Inventory_Header__c inventory : inventoryList){ Inventory_Header__c temp = new Inventory_Header__c(); temp.Id = inventory.Id; temp.Inventory_Status__c = null; tempList.add(temp); } UPDATE tempList; return '清除盘点状态完毕'; } catch (Exception e) { return e.getMessage(); } } }