Visual studio IsPortalEnabled从Contact调用时始终返回False
我只需要为门户用户执行一段代码。 我的代码在联系人上运行,我需要处理门户用户拥有的联系人 在我的if条件下,我被引用为contact.owner.isPortalEnabled 甚至联系人的所有者也是portaluser,在我的apex代码中,它总是给我假消息。 如果我在查询编辑器中对联系人运行查询,它将为我提供trueVisual studio IsPortalEnabled从Contact调用时始终返回False,visual-studio,triggers,salesforce,apex,Visual Studio,Triggers,Salesforce,Apex,我只需要为门户用户执行一段代码。 我的代码在联系人上运行,我需要处理门户用户拥有的联系人 在我的if条件下,我被引用为contact.owner.isPortalEnabled 甚至联系人的所有者也是portaluser,在我的apex代码中,它总是给我假消息。 如果我在查询编辑器中对联系人运行查询,它将为我提供true if(con.owner.isPortalEnabled){ // always returning false //do something } 选择Id、名称、Owner
if(con.owner.isPortalEnabled){ // always returning false
//do something
}
选择Id、名称、OwnerId、owner.isPortalEnabled from Contact,其中Id='0037j00000XWtkG'
以上的问题给了我真实的答案
if(con.owner.isPortalEnabled){ // always returning false
//do something
}
请帮助您在哪里运行代码和查询?如果在if语句正上方的调试消息中运行查询,是否返回true?如果是这样,那么你的联系方式可能有问题。如果这是假的,那可能是fls的问题。