简体   繁体   English

预先填充Salesforce.com中的字段

[英]Prepopulate fields in Salesforce.com

I have a doubt, i've been working with salesforce for a while and now i have a requirement from a customer. 我怀疑,我已经与Salesforce合作了一段时间,现在我对客户有要求。

They need that some custom fields be populated with a value of parent object, making some research on stackoverflow, i found this post , but this isn't working for me because my project is a manage package and when this is installed on a another salesforce instance the id of custom field change. 他们发现需要用父对象的值填充一些自定义字段,以便对stackoverflow进行一些研究,但我发现对我不起作用,因为我的项目是一个管理包,并且安装在另一个Salesforce上时实例自定义字段更改的ID。

if someone could help me, I will be grateful. 如果有人可以帮助我,我将不胜感激。

Thanks!. 谢谢!。

I can't see any way of doing the same as that post without using the IDs, I was thinking you could route via a VF page and build up the URL in the controller but it doesn't seem as though you can get the IDs of fields, just their type etc.. 我看不到任何不使用ID即可完成该操作的方法,我想您可以通过VF页面进行路由并在控制器中建立URL,但似乎无法获得ID字段,只是它们的类型等。

I think the best you could do in this instance is to override the default new recordpage with a visualforce page. 我认为在这种情况下,您最好的做法是使用visualforce页面覆盖默认的新记录页面。 In the constructor of your controller you could then loop through the page parameters and pre-fill the corresponding fields on the new record before it's displayed on screen. 然后,在控制器的构造函数中,您可以遍历页面参数,并在新记录显示在屏幕上之前预填充新记录中的相应字段。 Using fieldsets or just an <apex:Detail> component would keep the level of effort down and also maximise the flexibility of the page for the end users. 使用字段集或仅使用<apex:Detail>组件将降低工作量,并为最终用户最大化页面的灵活性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM