我已经正确更新了所有权限集,因为我可以在 select 语句所在的位置硬编码一个字符串“Test”,但是当我输入 select 语句时,我的聊天机器人会立即关闭。有人可以快速浏览一下吗?我正在尝试测试我是否可以获取电子邮件地址、搜索联系人对象并返回 appDecision(自定义字段)
public with Sharing class GetAdmissionStatus {
public class DecisionOutput {
@InvocableVariable( required=true )
public String aDecision;
}
public class DecisionInput {
@InvocableVariable( required=true )
public String applyEmail;
}
@InvocableMethod(label='Get Admission Status')
public static List < DecisionOutput > GetAdmissionStatus( List < DecisionInput > listDecisionInputs ) {
List < DecisionOutput > objOutputs = new List < DecisionOutput >();
DecisionOutput objOutput = new DecisionOutput();
Set < String > strapplyEmails = new Set < String >();
for ( DecisionInput objDecisionInput : listDecisionInputs )
strapplyEmails.add( objDecisionInput.applyEmail );
objOutput.aDecision = [ SELECT AppDecision__c FROM Contact WHERE Email IN: strapplyEmails LIMIT 1].AppDecision__c;
objOutputs.add( objOutput );
return objOutputs;
}
}