我收到错误条件表达式必须是布尔类型。
for (Account acc: trigger.new)
{
if(acc.RecordTypeId = [SELECT Id from RecordType WHERE sObjectType = 'Account' AND IsActive = True AND Name = 'Health Care' LIMIT 1].Id)
{
//some code
}
答案 0 :(得分:0)
if(pos.RecordTypeId == [SELECT Id from RecordType WHERE sObjectType = 'Account' AND IsActive = True AND Name = 'Health Care' LIMIT 1].Id)
使用双==
代替上述内容。