8 votes
Accepted

SOQL bug for null required-lookup fields?

This occurs because of an optimization during the "query planning" phase of a query. The query optimizer removes null values from filters on required fields. This optimization allows Salesforce to use ...
sfdcfox's user avatar
  • 481k
7 votes
Accepted

In order to check if a field is required or not, is the result of isNillable method sufficient?

First Approach - For the field to be required it has to meet 3 conditions: is Creatable is NOT Nillable is NOT Default on create So your if condition should be as following: if(field....
Derminal's user avatar
  • 356
6 votes

how can i remove a required option on close date(opportunity)

See this: Can I remove the required Close Date field in a new Opportunity? The standard "Close Date" field cannot be removed from any Opportunity Page Layout, nor can the "Required" property be ...
Mr.Frodo's user avatar
  • 5,804
6 votes
Accepted

How to find required fields for an sObject?

Please note that fields can be made required via other means which are difficult or impossible to detect. Validation rules, triggers, and Process Builder can all introduce errors when a field is not ...
Adrian Larson's user avatar
  • 149k
6 votes
Accepted

Why is the LastName field required for the contact? What is the best approach to import contacts that only have the first name?

As for the LastName being mandatory, I can only say that it's by design. And seems there were ideas to get it optional, but Salesforce doesn't have any plan to do so. So it is very unlikely we can get ...
Jayant Das's user avatar
  • 30.3k
6 votes
Accepted

Placing asterisk to to Lightning:input fields in LWC

You can use label-hidden variant and put label yourself: <template> <label>Middle Name</label> <abbr title="required" class="slds-required">**</abbr> <...
salesforce-sas's user avatar
5 votes
Accepted

How to convert a lead owned by queue?

When converting leads owned by a queue, the owner must be specified. This is because accounts and contacts cannot be owned by a queue. Even if you are specifying an existing account or contact, you ...
smukov's user avatar
  • 5,503
5 votes

How to make a standard field to not be required

Standard required fields are required. You can't make them optional. I have heard of people making Visualforce pages to set those fields to some value "behind the scenes", but they're still populated ...
sfdcfox's user avatar
  • 481k
5 votes
Accepted

Dynamically get required fields with JS Remote Objects

I approach a similar problem in my SObjectFactory test utility with a RequiredFieldsCache, but you can adopt a somewhat simpler approach because you don't care about the values for a particular field. ...
Adrian Larson's user avatar
  • 149k
4 votes
Accepted

how can i remove a required option on close date(opportunity)

As mention you cannot hide the field but you can change the label like you asked. Setup->Customize->Tab Names and Labels-> Rename Tabs and Labels Click [Edit] next to opportunities then click [Next],...
Jimmy Jay's user avatar
  • 150
4 votes

How to make a standard field to not be required

If I'm not mistaken, the only required "standard field" on Account by Salesforce is Name. This must be a custom field. You can make standard (non required) and non-standard fields optionally required ...
crmprogdev's user avatar
  • 40.9k
4 votes
Accepted

How does SObjectType.newSObject() works?

It will simply instantiate a new empty Account object. Required fields only come into play when you perform the DML. You will have to set those. This and the describe classes are useful when the ...
Eric's user avatar
  • 54k
3 votes

How does SObjectType.newSObject() works?

From the documentation: Constructs a new sObject of this type Basically: Account newAcc = (Account)Account.sObjectType.newSObject(); is same as: Account newAcc = new Account(); It returns the ...
Raul's user avatar
  • 18.7k
3 votes
Accepted

apex:inputText required="true" doesn't work as in the documentation

You seem to be missing <apex:messages/> in your vf page. By definition, it says: All messages that were generated for all components on the current page. If an <apex:message> or <...
Jayant Das's user avatar
  • 30.3k
2 votes
Accepted

How to ensure that article manager use specified values for custom article fields?

Creating a validation rule can very easily have the effect of making a field a required field. If that's going to happen, it's a good practice to mark the field as required in the page layout so a ...
crmprogdev's user avatar
  • 40.9k
2 votes

Required fields do not allow cancel

To add to the knowledge above, there is also a known issue with HTML-5 and commandbuttons which use "immediate=true": https://success.salesforce.com/issues_view?id=a1p300000008YvNAAU Even with ...
Bigears's user avatar
  • 1,091
2 votes
Accepted

Can I edit or remove universally require standard fields in Salesforce?

We just implemented something like this for Opportunities - we didn't have a need for setting close date. A URL Hack is what you are looking for. This allows you to prepopulate the required fields, ...
zainogj's user avatar
  • 1,854
2 votes

How to test for Visualforce required fields in Apex?

Apex unit tests are good to test your controller logic. Unfortunately, there is no built in mechanism to test your UI layer in Salesforce (which is always a bit of a pain). In addition, making the ...
mkorman's user avatar
  • 4,026
2 votes
Accepted

Visualforce Required Fields and rerender

Try specifying immediate="true" on your actionSupport tag. Without that attribute, the visualforce page will try to submit the form to the server, which will trigger the page validation. Specifying ...
battery.cord's user avatar
  • 8,767
2 votes

Make custom field become required when certain condition is fulfilled

The Validation rule for this would be like below ISPICKVAL(Type, "Other") && ISBLANK(Description__c)
Mohith Shrivastava's user avatar
2 votes

Make a custom field required when certain condition is fulfilled

While it's not possible to control field visibility on a standard page layout. You can have a validation rule (VR) to display a message, notifying them that the value is required: OR( AND( ...
o-lexi's user avatar
  • 3,094
2 votes

Compare field value to list of values in Visualforce 'Required' parameter

Just use a Set whitelist and add a Boolean property. static final Set<String> whitelist = new Set<String> { 'option 1', 'option 2', 'etc.' }; public Boolean isAccountRequired { get { ...
Adrian Larson's user avatar
  • 149k
2 votes
Accepted

Make field required on condition

You can use the rule like this... AND(ISPICKVAL(PICKLISTFIELD__c,'Yes'), ISBLANK(MULTIPICKLISTFIELD__c)) Hope this might helps...
Subhash's user avatar
  • 1,716
2 votes

Difference of data extension "required" and "nullable" attribute in marketing cloud?

As per the documentation Primary Key - Determines whether the system considers field to be the primary key of the table If you select this checkbox, the system requires that the value in this field ...
Viswanath Josyula's user avatar
2 votes
Accepted

LEX Equivalent of Immediate = TRUE?

A immediate="true" solution is not needed in Lightning, because validation must be done by the developer, not the framework. Yes, the error appears automatically for you, but it won't stop you from ...
sfdcfox's user avatar
  • 481k
2 votes

How to find required fields for an sObject?

For API version <= 44.0, there is no explicit isRequired method but there are a few methods that you can leverage to find required fields: for (Schema.SObjectField fieldToken : Schema.SObjectType....
ashpabb's user avatar
  • 21
2 votes

How to find required fields for an sObject?

Even though I'm not providing any answers to the original question, I want to add more information to this post that could be useful for others. Apparently, the nillable field in the SObject Describe ...
Jay Vercellone's user avatar
2 votes
Accepted

Figure out which fields are required from Setup

As far as I know of, there's no way from UI to get that information. But you can retrieve this information if you use Metadata API. You can use the attribute required on the CustomField metadata for ...
Jayant Das's user avatar
  • 30.3k
2 votes
Accepted

make a required field in VF page

When there’s a required field in a VF page and we submit the form, sever does a validation to make sure those have values populated. If there are no values form submission is rejected. You may want ...
Ranga's user avatar
  • 1,712
2 votes

Making Custom Field Required

You can make the field required: At the "database level", by setting it as requiring a value in the Field's definition. At the "page layout level", by setting it as required by ...
Phil W's user avatar
  • 34.1k

Only top scored, non community-wiki answers of a minimum length are eligible