您是否知道我如何将以下SOQL语句合并到一个我尝试过的几个选项中,并通过创建两个条目,我能够让它工作..我对APEX开发相当新我真的想做正确的事我知道太多Select语句可能会导致系统出现问题..!谢谢你的帮助 !!
return [select Id, OpportunityId from OpportunityLineItem
where OpportunityId =:opportunityId
and CARE_BMI_Sync_Behaviour__c = 'Sync ON'];
return [select Id, OpportunityId from OpportunityLineItem
where OpportunityId =:opportunityId
and HasQuantitySchedule = False AND HasRevenueSchedule = False];
答案 0 :(得分:1)
如果要返回由这两个单独的查询返回的行,那么您需要对不同的部分进行OR,例如。
return [select Id, OpportunityId from OpportunityLineItem
where OpportunityId =:opportunityId AND
(( CARE_BMI_Sync_Behaviour__c = 'Sync ON') OR
( HasQuantitySchedule = False AND HasRevenueSchedule = False)) ];