Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [boolean]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

How do I make my code more understandable? [closed]

I have simple logic with many if's and boolean (my switch). The point is that Additional_det_Id__c has a higher priority than Clients__c. So I have to check first of all Additional_det_Id__c, and just ...
-3
votes
1answer
19 views

Variable Global is not changed

Start static variable as true on first mute method to false I would like the second method to inherit the value of the first and not the global value calling the public method I want the boolean ...
0
votes
0answers
257 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
101 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
94 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
229 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
266 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 ...
3
votes
1answer
6k 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
464 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
694 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
354 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
425 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
1k 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 ...
1
vote
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
253 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
244 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
123 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
1k 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 ...
2
votes
2answers
7k 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
21 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
787 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
6k 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
69 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
474 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
40 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
1k 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
395 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
502 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
872 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
403 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 ...