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

发布于 2024-11-30 13:24:46 字数 768 浏览 0 评论 0 原文

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**".

现在我希望在我的“欢迎页面”上显示 2 个字段。

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

如果用户到达此“欢迎页面” strong>”通过潜在客户中的 hello 相关列表,然后此页面上的标签设置为潜在客户

我不知道该怎么做。 我可以在 currentpage URL 中获取 retURL,但它只给我 ID。 现在我不确定该 ID 属于客户还是潜在客户。

客户和潜在客户只是示例,可能还有更多对象。

1) I have created a custom object "Hello".
Added two lookup fields to it, one is associated to Accounts and another to Leads.

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**".

Now I want that on my "Welcome Page" I want to display 2 fields.

If user reached this "Welcome Page" via hello related list in accounts then label on this page is set to Accounts

but

If user reached this "Welcome Page" via hello related list in leads then label on this page is set to Leads.

I dont know how to do this.
I can get the retURL in the currentpage URL but it gives me only the id.
Now I am not sure this id belongs to Accounts or Leads.

Accounts nad leads are just examples,there could be many more ojects.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

来世叙缘 2024-12-07 13:24:46

通过查看 id 的前三个字符,您可以判断对象的类型。例如,所有帐户均以“001”开头,所有潜在客户均以“00Q”开头。您可以从 ApexWeb 服务 API 。 API 还在 DescribeGlobalResult< 中返回此内容/a>,如果您想在一次调用中加载所有键前缀,这会很方便。 REST API 也有键前缀,但您需要必须遍历所有对象才能到达它。

By looking at the first three characters of the id, you can tell the type of object. For example, all Accounts start with '001' and all Leads start with '00Q'. You can get all the key prefixes from the DescribeSObjectResult in either Apex or the Web Services API. The API also returns this in the DescribeGlobalResult, which is handy if you want to load all the key prefixes in one call. The REST API also has the key prefix, but you'd have to traverse all the objects to get to it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文