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.
发布评论
评论(1)
通过查看 id 的前三个字符,您可以判断对象的类型。例如,所有帐户均以“001”开头,所有潜在客户均以“00Q”开头。您可以从 Apex 或 Web 服务 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.