Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.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
将salesforce中的一个对象与多个对象关联_Salesforce_Apex Code - Fatal编程技术网

将salesforce中的一个对象与多个对象关联

将salesforce中的一个对象与多个对象关联,salesforce,apex-code,Salesforce,Apex Code,1) 我已经创建了一个自定义对象“Hello”。 添加了两个查找字段,一个与帐户关联,另一个与潜在客户关联 2) now my custom object appears as a related list in both Account and lead 3) if i goto an account say "**Test_account**" >> i click on the new button on the "Hello" related list.here

1) 我已经创建了一个自定义对象“Hello”。 添加了两个查找字段,一个与帐户关联,另一个与潜在客户关联

2) now my custom object appears as a related list in both Account and lead

3) if i goto an account say "**Test_account**"  >> i click on the new button 
   on the "Hello" related list.here i have redirected to a custom 
   visualforce page "**Welcome**".
现在我想在我的“欢迎页面””上显示两个字段

如果用户通过帐户中的hello相关列表到达此“欢迎页面”,则此页面上的标签设置为帐户

但是

如果用户通过leads中的hello相关列表到达此“欢迎页面”,则此页面上的标签设置为leads

我不知道怎么做。 我可以在currentpage URL中获取retURL,但它只提供id。 现在我不确定这个id是否属于客户或潜在客户


帐户和潜在客户只是示例,可能还有更多的项目。

通过查看id的前三个字符,可以判断对象的类型。例如,所有客户都以“001”开头,所有潜在客户都以“00Q”开头。您可以从或中的DescribeSObjectResult中获取所有键前缀。API还将在中返回该值,如果希望在一次调用中加载所有键前缀,这将非常方便。也有键前缀,但您必须遍历所有对象才能找到它。

通过查看id的前三个字符,您可以知道对象的类型。例如,所有客户都以“001”开头,所有潜在客户都以“00Q”开头。您可以从或中的DescribeSObjectResult中获取所有键前缀。API还将在中返回该值,如果希望在一次调用中加载所有键前缀,这将非常方便。也有键前缀,但您必须遍历所有对象才能访问它