public class TenderingButtonController { @AuraEnabled public static InitData initTenderingController(String recordId) { InitData res = new initData(); try{ Tender_information__c report = [SELECT OpportunityNum__c,OwnerId,Id,status__c,Name,IsRelateProject__c FROM Tender_information__c WHERE Id = :recordId LIMIT 1]; res.OwnerId = report.OwnerId; res.Id = report.Id; res.status = report.status__c; res.name = report.Name; res.opportunityNum = String.valueOf(report.OpportunityNum__c); res.isRelateProject = report.IsRelateProject__c; res.profileId = UserInfo.getProfileId(); System.debug(LoggingLevel.INFO, '*** xu: ' + res); }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** xu: ' + e); } return res; } // 招标项目失单 TenderOpportunityLink // 调用该接口var sql = "select id from Tender_Opportunity_Link__c where Tender_information__c='" + '{!Tender_information__c.Id}'+ "'"; @AuraEnabled public static List sqlResult (String id) { try { List TenderOpportunityLink = [SELECT id FROM Tender_Opportunity_Link__c WHERE Tender_information__c = :id]; System.debug(LoggingLevel.INFO, '*** xu1: ' + TenderOpportunityLink); return TenderOpportunityLink; } catch (exception e) { System.debug(LoggingLevel.INFO, '*** xu1111111: ' + e); throw new AuraHandledException(e.getMessage()); } } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public String OwnerId; @AuraEnabled public String status; @AuraEnabled public String name; @AuraEnabled public String opportunityNum; @AuraEnabled public String isRelateProject; @AuraEnabled public String profileId; } }