global class InvocableUtil { global class LoggingRequest { @InvocableVariable(required=true) public ID objId; } @InvocableMethod(label='耗材审批驳回取消,删除明细') global static void createLog(List requests){ List objIdList = new List(); for(LoggingRequest requestObj:requests){ objIdList.add(requestObj.objId); } Set selectAssetIdSet = new Set(); List caesdList = [SELECT Id, Asset__c FROM Consum_Apply_Equipment_Set_Detail__c WHERE Consum_Apply__c = :objIdList]; for (Consum_Apply_Equipment_Set_Detail__c caesd : caesdList) { if (String.isNotBlank(caesd.Asset__c)) { selectAssetIdSet.add(caesd.Asset__c); } } List ass = [SELECT Id FROM Asset Where Id =:selectAssetIdSet FOR UPDATE]; Delete caesdList; } }