Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [boolean]

The tag has no usage guidance.

0
votes
0answers
26 views

Single select checkbx in Lightning datatable

I have lightning datatable with below definition Component table definition: <lightning:datatable aura:id="PYearTable" columns="{!v.columns}" data="{!v.data}" ...
1
vote
1answer
44 views

Get Boolean result by String expression in APEX [duplicate]

I have a string conditions logic that retrieves values for a Map<String,Boolean> and checks if logic is true or false. For example my logic looks like: ((1A2)O3) Being A => AND and O => OR. ...
1
vote
1answer
44 views

Insert or Update Custom Metadata Type Boolean Field

How, or can we, update Custom Metadata Types that have a checkbox field using the MDAPI? When I set it to '1' or 'true' in both instances it says value not of required type: <?xml version="...
0
votes
1answer
156 views

SOQL: Retrieve records based on List of Booleans

I have this json object coming in for boxes: Boxes: [ { count: 5, Fragile: true }, { count: 10, Fragile: false } ], I have box records that need to be updated based on if they are fragile or not ...
3
votes
1answer
180 views

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

Being that an if (booleanVariable) check, where booleanVariable is null, throws a NullPointerException, it would seem that this check is unsafe. If so why would Apex allow it? This is especially true ...
2
votes
1answer
3k views

lightning component empty field check?

<aura:attribute name="guid" type="String" default="{!v.simpleRecord.Loan_Guid__c}"/> <aura:attribute name="fileCreated" type="Boolean" default="{!v.guid != '' ? true : false}"/> ...
2
votes
1answer
237 views

Boolean Value Resets to True in Test Method

Trying to get code coverage up and I am not understanding why this boolean value will not pass from the test method to the class. It always returns true. Test Method: @isTest static void ...
1
vote
2answers
391 views

Variable does not exist - global Boolean and webService Argument

I am trying to pass an argument from a webService function within a global class and assign it to global variable within that class, but when I try to call the value within the class, or even within ...
0
votes
1answer
221 views

Can't update Boolean value of Account object

I cannot update update this Boolean value in Apex. What is going wrong? The if statement, and the fact that the front end representation is a checkbox, proves that it is indeed a boolean value. I am ...
0
votes
1answer
301 views

Calculate and Output a checkbox in Visualforce

Currently, I'm using apex:inputCheckbox and feeding it a boolean value from the controller with a dedicated variable since the Value attribute in the apex:inputCheckbox cannot have a formula ...
0
votes
0answers
21 views

Updating a value in the list to be updated before and after the dml operation

Im trying to update child record in parent after trigger, where i need to update this child's boolean (MA_Campaign_Qty_Boolean__c) as part of restricting some validation in child's trigger for this ...
0
votes
1answer
776 views

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

I have a Synchonised Data Extension for SFSC Contact in SFMC. There is a Custom Checkbox field in the Contact object that I am trying to use as a filter in a SFMC Query. The SFMC field was ...
0
votes
1answer
1k views

How to get value for boolean variable from controller

I have a controller where I have this code. I need to pass BooleanVariableName to another controller PageReference pageRef = new PageReference('/apex/ContactV1?id=' + contact.Id); pageRef....
0
votes
1answer
241 views

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

I have been trying to add a contact to a data extension in Contact Builder. I have two boolean fields - REQUIRED fields, called doNotUse and suppressJourney. The default value of these fields are both ...
2
votes
1answer
232 views

Custom Boolean Field Retrieve

I'm currently only able to retrieve non-boolean columns from a SOQL query when using the SforceEnterpriseClient. In the below query Columns1 and Column2 fail to return data to me. SELECT Column1__c, ...
1
vote
1answer
115 views

Test Coverage Drops from 92% to 21% if @testSetup inserts more than 200 records through a Trigger with a RunOnce boolean

A few months ago, I asked this question: Question regarding "RunOnce" Booleans on AfterUpdate methods in a Salesforce Transaction The answer provided indicated that I should move my RunOnce ...
4
votes
1answer
738 views

Question regarding “RunOnce” Booleans on AfterUpdate methods in a Salesforce Transaction

I recently encountered a business logic bug in our org that was accidentally deducting a customer 2x for completing an event that only actually occurred once. Using dev console I was able to determine ...
1
vote
2answers
6k views

Cannot convert Boolean to String

I have a need to show the boolean value as string and I'm trying to convert boolean to string but its not coming along, here is what I have done so far: try to convert using String.valueOf but does ...
1
vote
1answer
20 views

Quote Trigger Initial term of field expression must be a concrete SObject: Boolean at line 32 column 89

I can't seem to figure my issue here on the code below. Originally I had Opportunity__c and was getting a invalid field error. I replaced Opportunity__c with the OpportunityId field and received the ...
1
vote
1answer
627 views

Data Loader Export Booleans as 1 or 0

Does any one know if it is possible for the data loader tool to export boolean values as a 1 or 0 instead of the "True" or "False"?
6
votes
1answer
4k views

Query For Custom Metadata Type WHERE Field = false Returning 0 Rows But Matching Record Exists

I'm querying my Custom Metadata Type VRecTypeNm__mdt using SELECT Label,ProductName__c,ProductCategory__c,EuOpps__c,NaOpps__c,PhysicalCard__c FROM VRecTypeNm__mdt WHERE Label = 'CP Virtual All In ...
0
votes
1answer
67 views

Attempt to reference null exception

I am getting the above error at below line. Can someone Please let me know? It should be true or false , why null? Apex class List<Account> Accnt= [select ID , Name , ...
0
votes
1answer
3k views

pass html input checkbox to controller

i try to get the value from <input type="checkbox">and pass it to my variable on controller but i always get 'Argument cannot be null'. i already try using inputHidden to <select> tag and &...
1
vote
1answer
1k views

Button Render depending on a boolean value

I have the following piece of code function toggleButton(box, id1, id2) { var elm1 = document.getElementById(id1); var elm2 = document.getElementById(id2); if(box.checked){ elm1.style.display = ""; ...
0
votes
2answers
1k views

Comparing fields in two different objects in a SOQL query

I am trying to create an Apex Controller that outputs a list of event records. I would only like to print the oldest from each account where the Event is a meeting. After much thought I think the best ...
1
vote
2answers
451 views

Getting null value from standard getter method of sObject

I am stuck in a very strange situation. I have one custom object (test_Boolean__c) and a field of checkbox type (check_Boolean__c) whose default value is true. Now this is what I did :- Created a ...
1
vote
1answer
36 views

Render condition error throws

I have below render condition that throws error. Can someone let me the correct condition? Please counter is a get set Integer value in controller that increments after a check in for loop inside ...
1
vote
1answer
957 views

Access a boolean variable from the controller by another helper class

I got a boolean variable in my controller class and I want to access that variable to check a condition in another helper class. Ex: Class MainController { public boolean showValue {get; set;} ...
1
vote
2answers
371 views

Avoid recursion in trigger - handling multiple triggers

I'm using this sample code from Developerforce to avoid recursion in triggers. public class TriggerMonitor { private static boolean run = true; public static boolean runOnce() { if( ...
4
votes
1answer
3k views

CASE function with Boolean

I am trying to make a checkbox (boolean) formula field on a custom object, using a CASE function to set the value. I have 5 or 6 values from a picklist that I would like to set the new checkbox to ...
0
votes
1answer
472 views

Evaluate a Boolean expression from dynamic string in loop

I want to track our email lists dynamically using a single-choice picklist for each email list with options of 'Subscribed' and 'Unsubscribed' that automatically assigns subscribers to a Campaign. I ...
8
votes
1answer
2k views

Why are my default values always null for checkbox/boolean fields?

I setup a field in Salesforce: When looking at the metadata for my custom object containing this field, this is the data on that metadata field: "defaultValue": null, "defaultedOnCreate": ...
1
vote
2answers
725 views

Checking states of multiple Booleans

The below class works fine, in that it declares my four Booleans and performs some logic to assign them an appropriate state. I don't like the getMultiCheck method. Can it be written any better? It's ...
3
votes
1answer
370 views

Complement result from function in rendered attribute

So in my rendered attribute I am calling a getter method that returns a boolean. However I want to set rendered to the opposite of what it returns because it is used to render one component or another....
9
votes
3answers
1k views

Generic SObject Getters Return Null for Boolean fields?

Question Am I taking crazy pills are is it unexpected behavior for the generic sObject getters to return null for boolean fields? Background Was troubleshooting a null pointer error and noticed ...