Skip to main content
11 votes
Accepted

Boolean Value Resets to True in Test Method

if (standardSearch = true) { You are performing an assignment with = inside this if statement. Use == to compare for equality. As a guard against this kind of mistake, you can write the constant ...
David Reed's user avatar
  • 93.7k
9 votes
Accepted

Apex `if (Boolean) `. Null exception virtually renders this check useless and unsafe

It's allowed because a Boolean is already a Boolean; the syntax for an if statement reads if(condition), where condition is a Boolean value. It's considered a best practice to always initialize your ...
sfdcfox's user avatar
  • 502k
9 votes
Accepted

lightning component empty field check?

Use empty to determine if something is empty (or, in this case, not empty): {!not(empty(v.guid))} However, I'm not sure you can do all this with the "default" attribute, since it's not meant to be ...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

Get Boolean result by String expression in APEX

Answer of your question: No even if you replace complete String with actual expression there is no way you can parse it. For parsing the expression you would need to write the parser. Write Parser: ...
Mr.Frodo's user avatar
  • 5,822
4 votes

Trigger.oldMap.get on a boolean field

Those maps are keyed by record Ids. So when looking for differences between the values of of the fields in the old and new records use this pattern: // n = new version of record // o = old version of ...
Keith C's user avatar
  • 137k
3 votes

How to get value for boolean variable from controller

All parameters are passed as strings so you will have to do this: if you are not going to ever call the controller from anon apex and always be in VF context you can do this (sfdcfox): boolean pbv = ...
Eric's user avatar
  • 54.4k
3 votes
Accepted

Variable does not exist - global Boolean and webService Argument

Non-static variables (commonly called instance variables) are specifically contained in an instance of a class. Static variables, contrariwise, are stored in class' static storage area, of which only ...
sfdcfox's user avatar
  • 502k
2 votes

Variable does not exist - global Boolean and webService Argument

You can't assign instance variables from a static context. Instead of: global boolean awsUpdate; Use: global static Boolean awsUpdate; Or consider public/private access modifiers if they are ...
Adrian Larson's user avatar
  • 151k
2 votes

How do I use a formula text field to display in a record whether a candidate has been approved or not, based off a checkbox?

In a formula (formula field, workflow, process builder, flow), the IF() function takes 3 arguments (as indicated in your previous question by looking through the Formula Operators and Functions). ...
Derek F's user avatar
  • 64.1k
2 votes
Accepted

Formula field date subtraction

Simple date subtraction, as Amit suggests in the comments, would be a decent approximation. Datetimes (and their closely related cousin, Dates) can be subtracted to give you a decimal (in the case of ...
Derek F's user avatar
  • 64.1k
1 vote
Accepted

How to split a multiselect picklist into a String array and check if it contains a specific value within an iteration?

Your constant is Non-Inherited (uppercase I), while the value in the multipicklist is Non-inherited (lowercase i), they are not the same string. Only the equality operators (==) and WHERE clause in ...
RubenDG's user avatar
  • 9,567
1 vote

LWC Boolean Properties

This can be used as a work around. @api booleanVariableName = !false;
hamishS's user avatar
  • 11
1 vote
Accepted

LWC Boolean Properties

as per the documentation says Always set the default value for a boolean public property to false. If you set the default value to true instead in bool.js, there’s no way to statically toggle the ...
Aman Patil's user avatar
1 vote

Formula field - Trying to show a flag if checkbox = true

You need to use the field API Name instead of label name (Response Timer Failed) in the formula field. your formula should be like below and the formula return type should be text IF(...
Ankaiah Bandi's user avatar
1 vote
Accepted

How to change boolean result to a compatible currency value in a formula field

A few things to note here: When you are making multiple comparisons against a single field, you should consider using CASE() to save yourself a potentially significant amount of typing A formula ...
Derek F's user avatar
  • 64.1k
1 vote

How to change boolean result to a compatible currency value in a formula field

Remove the last IsBlank(null) instead, just make it null. By saying IsBlank, you are returning true (as null is always blank) and hence the complain from the compiler.
metasync's user avatar
  • 1,792
1 vote
Accepted

Trigger.oldMap.get on a boolean field

Trigger.old is Map of Case Id and Case instance. To retrieve the field values, you will need to specify the ID as index and then the field name to get the corresponding values. Trigger.oldMap.get(...
S..'s user avatar
  • 1,215
1 vote
Accepted

Variable Global is not changed

It sounds like this is what you're attempting to do from the comments. This exposes a public method that grabs the internal variable from a private static method which gets it from the private static ...
drakored's user avatar
  • 2,718
1 vote
Accepted

Insert or Update Custom Metadata Type Boolean Field

The issue is that you are specifying incorrect data type. <values> <field>hdone__IsActive__c</field> <value xsi:type="xsd:string">yes</value> </values> If ...
Aayush K's user avatar
  • 1,500
1 vote
Accepted

SOQL: Retrieve records based on List of Booleans

Architecture and Data Model Commentary You may have very good reasons for adopting this data model, but looking in from the outside I think it's going to cause you more problems than it helps. If your ...
David Reed's user avatar
  • 93.7k
1 vote
Accepted

"This field may not be empty" - it isn't!

I'd suggest opening a support case. As a work-around, you can export the data, fix the values in the file and re-import it. Also, make liberal use of the Feedback button at the top of the page. ...
Adam Spriggs's user avatar
  • 31.1k
1 vote
Accepted

Custom Boolean Field Retrieve

I strongly suspect that there is something wrong with enterprise WSDL. possible options to check are: Check if the WSDL is latest or not Check the path of WSDL - its possible that you may be ...
AtulRajguru9's user avatar
  • 9,160
1 vote
Accepted

Can't update Boolean value of Account object

You need to set the RecordTypeId to a Person Account record type, or you won't be able to use "PC" fields. Also, you cannot use the Name field for a Person Account, because it's used only on Business ...
sfdcfox's user avatar
  • 502k
1 vote
Accepted

Calculate and Output a checkbox in Visualforce

You can do this with a normal "input", but it's pretty painful. Here's what it would look like: <apex:outputText rendered="{!NOT(ISNULL(current.Text__c))}"> <input type="checkbox" checked="...
sfdcfox's user avatar
  • 502k
1 vote

Can you filter on a Boolean/Checkbox in a Marketing Cloud SQL Query

Try subbing True for 1 and 0 for False. It should work. In SFMC these work as booleans values. SELECT c.Id , c.Email , c.FirstName , c.LastName , c.Checkbox__c FROM Contact_Salesforce c WHERE ...
0xsegfault's user avatar
  • 6,613

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