如何在 Apex Salesforce 页面中添加自定义文本输入字段?
我在 Apex 中使用表单创建了一个页面,在此处输出: http://globalexperiences.com/general/contactus .php
我在潜在客户中创建了一个新字段(也在帐户中,但没有实际意义),并尝试调用它来输出某人可以输入的文本字段。我的代码是这样的:
<apex:outputLabel value="Skype Name: " for="inputSkypeName" />
<apex:inputText id="inputSkypeName" value="{!lead.Skype_Name__c}" />
每当我尝试使用我创建的任何其他字段时,它都会输出输入字段,但对于这个字段,它只输出标签。我在任何地方都找不到这方面的任何文档。请帮忙!
I have a page created with a form in Apex that outputs here: http://globalexperiences.com/general/contactus.php
I've created a new field in Leads (also in Accounts but that's moot) and am trying to call it to output a text field that someone can enter into. My code is this:
<apex:outputLabel value="Skype Name: " for="inputSkypeName" />
<apex:inputText id="inputSkypeName" value="{!lead.Skype_Name__c}" />
Whenever I try it with any other field I've created, it outputs the input field but for this one it just outputs the label only. I can't find any documentation on this anywhere. Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用
为 sObject 字段生成编辑器。apex:inputText
主要用于控制器/扩展属性。 inputField 还确保非文本字段(例如查找、日期等)在呈现的 HTML 中得到正确的表示。Use
<apex:inputField>
to produce editors for sObject fields.apex:inputText
is used primarily for controller/extension properties. inputField also makes sure that non-text fields (such as lookups, dates, etc) get proper representation in rendered HTML.检查该字段的字段级安全设置是否正确。它需要对您用来查看页面的个人资料可见。
另外,如果您希望这样的字段能够正确呈现,您需要在它周围放置标签。
Check that the field level security is setup correctly for this field. It will need to be visible to the profile you are using to view the page.
Also, if you want a field like this to render properly, you 'll need to put tags around it.
按照上面的建议检查字段级安全性,并检查用户的配置文件是否具有对相关自定义对象的读/写访问权限 - 如果他们仅具有读访问权限,则该字段将不可编辑。
Check field level security as suggested above and also check whether the user's profile has read/write access to the custom object in question — if they only have read access then the field will not be editable.
在页面控制器中,如果您使用自定义控制器或不使用标准控制器,请确保您正在查询该字段。
In your Page Controller if you're using a custom controller or not using the Standard Controller make sure you're querying the field.