Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio IsPortalEnabled从Contact调用时始终返回False_Visual Studio_Triggers_Salesforce_Apex - Fatal编程技术网

Visual studio IsPortalEnabled从Contact调用时始终返回False

Visual 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条件下,我被引用为contact.owner.isPortalEnabled

甚至联系人的所有者也是portaluser,在我的apex代码中,它总是给我假消息。 如果我在查询编辑器中对联系人运行查询,它将为我提供true

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的问题。