有多种方法可以将自定义字段设置为必填字段。我们将提供每个可用选项的一些信息。
这是最严格的要求,它要求始终输入字段,而不管记录是如何保存的(即通过集成、API、批量上传或通过用户界面)。阅读这些说明以了解更多信息。
要求字段输入以确保数据质量
自定义字段属性
在 Salesforce Classic 中
在 Lightning Experience 中
只有在访问您设置了此要求的特定页面布局时,此选项才会使该字段成为必填字段。因此,从技术上讲,您可以为使用特定页面布局的一些用户设置为必填项,而其他用户则不需要。请查看使用增强页面布局编辑器自定义页面布局。
注意: 此要求仅适用于在用户界面上编辑记录的情况。当通过 API 字段更新记录时,要求不适用。
在 Salesforce Classic 中
在 Lightning Experience 中
使自定义字段成为必填字段的最简单的验证规则如下所示:
ISBLANK(Enter_Custom_Field_API_Name_Here__c)
或者,如果字段是数字或货币类型字段,请使用以下语法:
ISNULL(Enter_Custom_Field_API_Name_Here__c)
您可以构建包含条件语句的更复杂的验证规则来满足您的业务需求。请查看定义验证规则。
注意:与字段级别设置一样,这将始终适用,无论在哪里创建或更新记录。请阅读验证规则注意事项,以了解此操作将具有何种影响。
在 Salesforce Classic 中
对于自定义对象:
在 Lightning Experience 中
另请参阅:
创建自定义字段
有条件地将字段设置为必填字段
动态表单可用于在新建和编辑模式上创建必填字段,以及 Lightning 记录页面。 请查看动态表单中的必填和只读字段。
注意: 如果您在 Lightning 应用程序生成器属性面板中将 Lightning 页面上的字段设置为必填或只读,则该行为仅适用于该页面上的字段,而不适用于该字段的所有实例。
在 Lightning Experience 中
000384974

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.