Questions tagged [null]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
3answers
50 views

Null check condition for User object SOQL query

Below is the query I have used :- User singleUser= [SELECT id,name,alias FROM user WHERE alias = 'random' AND name = 'Random Name' LIMIT 1]; In the IF condition I want to check for the null ...
-1
votes
4answers
36 views

Make !=null check

Could you please help me make a !=null check here? public static Integer getUserOpenCasesBasedOnTerritory(String userId) { return getUserOpenCasesListBasedOnTerritory(userId).size(); }
0
votes
2answers
42 views

Force RecordTypeId to Null on Contact

I am working in a very old org where majority of the contacts do not have a recordtypeid, and contact visibility, page layout assignments revolve around this master no record type id contact record. ...
0
votes
1answer
30 views

Getting a null pointer exception

I was trying to fix a null pointer exception here if(com.Employee__c != null && (mapEmployees.containskey(com.Employee__c) == null || (mapEmployees.containskey(com.Employee__c) != null &&...
0
votes
0answers
127 views

Flow is not setting values to Null

In the flow I have a very simple get of records. I only return the first record. I have the box checked, However, when I test my var with '{!var.Id}', IS NULL = true, in a screen component. It is ...
1
vote
1answer
60 views

aex:repeat can't display null values in visualforce page?

Hi I've forcefully added a null value inside a list so when I create a table I can see empty cells. Is the behavior of apex:repeat not displaying null?
3
votes
2answers
132 views

DateTime Formula Field Null in Apex, Not Null in UI

I created three formula fields on a custom object. Formula(Date) references parent objects Formula(Time) references parent objects Formula(DateTime) references formula field 1 & 2. When I ...
0
votes
0answers
12 views

Process empty values in Process Builder

I want to update five fields in the contact object, coming from "Log a Call" (activity). - These fields always show the latest call. - I want all these five fields to be updated - even if they're ...
0
votes
0answers
35 views

inputRichText removing alt and title attribute and showing title null after post

I am creating Feed Posts using a custom component in which I have used lightning:inputRichText But it is removing alt and title attributes from the anchor tag. And if I am not passing the alt and ...
0
votes
0answers
55 views

Getting null values when retrieving Flows via Apex Metadata API

When attempting to retrieve Flow-specific data via the Apex Metadata API each value in the key-value pairs is null. Here is the code: private static void getFlowMetadata(Double apiVersion, ...
1
vote
2answers
74 views

Null Value assigned at initial value of For Loop, does this produce Null Pointer Exception Errors?

I'm getting a very weird scenario for a for loop. I'm running the following code: List<Id> conId = new List<Id>(); List<Customer__c> customers = new List<Customer__c>(); ...
0
votes
1answer
794 views

How to reference cross object field in Process builder and not allow for null values to not prompt error?

So in a custom object in process builder, I'm trying to use a formula to populate the AccountBillingCity__c in the custom object using values from Account object, standard field BillingCity. So I use ...
0
votes
2answers
61 views

Wrong decimal formula: I can't get the right value

I use this formula field in my apex code. But I have big troubles with it, because there should be different logic for values 0 and NULL. If I choose Treat blank fields as blanks, I'll get NULL even ...
3
votes
2answers
116 views

Comparision directly on null value safe?

So many times, we do a null check of a field value and then compare them boolean checkAmountGreaterThan10k(Opportunity record){ if(record.Amount!=null){ return record.Amount > 10000; ...
1
vote
1answer
705 views

How to assign aura:attribute for objects with default value null?

This must be a a very simple question, but may be I'm doing it wrong. I wanted to set default aura:attribute value to null on lightning component as below. e.g. <aura:attribute name="selectedObj"...
1
vote
2answers
63 views

Unable to handle Attempt to de-reference a null object with map

I'm working on after update trigger. And it's throwing an exception after I'm checking null values too. i don't have any idea why it's public void AfterUpdate(Map<Id, SObject> newItems, Map&...
0
votes
1answer
1k views

Database.Query does not return fields with null value

Hi i'm executing this query using Database.Query(query) Where query is SELECT field1__c, field2__c, field3__c FROM Object1__c On the current record, field3__c is NULL but when i query on the ...
4
votes
1answer
372 views

Attempt to de-reference a null object: list initialization

I initialize the list at the beginning of the code. In one of the methods, I add values ​​to it. In another method, the list is already empty. But I need these values ​​in the second method. How to ...
0
votes
1answer
29 views

String variable takes null value randomly after the first execution

In the first execution checkNumber takes the value from visualforce page properly.But after that sometimes checkNumber takes null value and shows the 'Please enter at least one search criteria' error ...
3
votes
1answer
882 views

Adding null to Set<Id> doesn't return an empty Set

Set<Id> testIds = new Set<Id>(); testIds.add(null); system.debug('testIds are ' + testIds); system.debug('Size of the set is ' + testIds.size()); system.debug('isEmpty result is ' + ...
3
votes
3answers
1k views

JSON.serialize: is it possible to suppress null values of a map?

I tried to serialize a map with null value (api 45): Map<String, String> bodyMap = new Map<String, String> {'key'=>'value', 'key2'=>null}; System.debug(JSON.serialize(bodyMap,true));...
1
vote
0answers
88 views

Can Jitterbit (or any ETL tool) do field-by-field “insert null values” without using the bulk API?

I can see that when an ETL tool is using the Bulk API, there isn't a global "insert null values" setting and you have to explicitly set cells to #N/A to get them to overwrite to null. That's nice, ...
1
vote
2answers
327 views

System.QueryException: execution of BeforeUpdate caused by List has no rows for assignment to SObject ()

I am receiving the following sync error in Pardot: System.QueryException: execution of BeforeUpdate caused by List has no rows for assignment to SObject () I think it is this trigger that is ...
1
vote
2answers
30 views

Field not available in list from SOQL

I have a custom field that is populated by integration, and in certain cases a currency field will end up as blank. It will not evaluate to null or 0. SQL Execute from dev console log: 13:26:53:006 ...
0
votes
1answer
85 views

Why does the trigger always read my if statement as null? [duplicate]

See the code below from an APEX trigger. For some reason, my trigger always reads nextRenewalDate (field from Account object) as null, regardless of whether or not it is blank. Racking my brain here ...
0
votes
1answer
15 views

Why does my country returns null on creating an account?

I am creating a testdatafactory. creating a country goes well. When creating accounts my country fields are null if i debug CountryList it returns the created country record. Factory class @isTest ...
0
votes
0answers
33 views

Null Value for record after getting id from a map of ids and accounts

The system.debug shows that the id for TempAcct is associated with the correct id after a.get('Franchise__c'), but NewAcct = null. The debug shows that the id was mapped correctly to filterIds, and it'...
2
votes
3answers
3k views

Null List VS Empty List

I have a basic question about how a list is loaded. Consider these scenarios: List<Lead> leadList1 = [SELECT Id FROM Lead]; List<Lead> leadList2 = new List<Lead>(); List<Lead&...
0
votes
1answer
617 views

Batch error: Attempt to de-reference a null object with check for !=null

I have a batch apex where I insert some records. I check on the fields for != null but still get the error: Attempt to de-reference a null object Here is my batch part: global void execute(...
2
votes
1answer
222 views

How do I set a string field to null in a Big Object using Apex?

Is that something that is not allowed? Is it a bug? I just tried and it did not seem to set anything. The index of Named_Entity_Big__b is over the following, and I'd like to set Result__c to null: ...
2
votes
1answer
63 views

Expected behaviour in a query filtering by parent null field

What should I spect when the account is null in the below code? SELECT Id, name, Account__c FROM AccountChildren WHERE Account__r.someField = true I am having issues debugging the query and I would ...
2
votes
0answers
101 views

How does an approval step's criteria handle nulls?

I have a custom User field, a nullable integer. As expected, I see the following behavior: $User.Custom__c <> 0 // FALSE $User.Custom__c = 0 // FALSE Apex works the same way, and this ...
5
votes
2answers
25k views

Lightning Component Visibility filter to check if value is null

How can I set a Lightning Component visibility based on text filed value = NULL. I have a text area field and I want to only display one component if Text area field contains value. I can't seem to be ...
0
votes
1answer
479 views

Test class throwing argument cannot be null error

I am seeing System.NullPointerException: Argument cannot be null in my test class Below is the controller method that i am trying to cover : public void Synchsongmethod() { system.debug(...
1
vote
1answer
435 views

Try/Catch for Attempt to Dereference Null Object

Is there a way I can test with an IF statement for a null object. Using an IF (obj==null) throws the error. How can I account for these? With SOQL, I use a list and check the number. However, the ...
0
votes
1answer
386 views

SOQL Field returning null when it is not

I have a custom field: Show_DateTime__c which is a formula(Date/time) When I run the following anonymous apex: Coverage_Request__c covreq = [Select Show_DateTime__c, name from Coverage_Request__c ...
1
vote
2answers
8k views

Filter NULL values in reports?

How can I filter out NULL values from within the reports editor for a text field?
0
votes
2answers
26 views

Map not getting populated

I have below code where the Map is not getting populated and throws Null Pointer error. System.NullPointerException: Attempt to de-reference a null object Code: for(Business_Plan_abv__c obj : [...
5
votes
1answer
165 views

Keep null values in Remote JSON call [closed]

I'm working with an external app that is making callouts to Remote Actions in my controller. When I return the value to them, it's returning a custom data structure with 2 parameters, result, and ...
1
vote
2answers
915 views

Making “Null” as “” in JSON payload

I am trying to push a JSON input payload, but some fields might be blank. The receiving system has a problem with it. They want either the blank fields to not be sent all together or replace "Null" ...
0
votes
1answer
33 views

Null values for one custom field

I have below trigger block. I am getting null values for dsrl.Related_Opportunity_del__r.Business_Group__c. if(Trigger.isbefore && (Trigger.isInsert|| Trigger.isUpdate)){ System.debug(...
9
votes
2answers
1k views

Ambiguous method signature on NULL value

I know that all primitive types are objects and can be null in Apex But is there a way to handle the null value when doing polymorphism ? public class myClass{ public myClass(String name){ ...
3
votes
1answer
2k views

How to insert/pass NULL value into Date field

I am trying to insert a null value into a field of type Date (in SalesForce) using a PHP Script. Here is my logic. $Date = '', $createField['Date__c'] = $Date; I tried the following, but none of ...
0
votes
2answers
42 views

Null Account in insert procedure in Contact

I'm trying to add an Account id to Contact but when I do the insert and than I check the Contact just created it appear null. I'm using the following code: Account Acc = [SELECT id FROM Account ...
3
votes
1answer
434 views

How to handle optionally null related objects in process builder?

We have a custom object that can be associated with an account. Since this object type is usually created by an automated process, we'd like to trigger emails to account owners when these objects are ...
1
vote
2answers
682 views

Event WhoID is null in lightning?

i created a trigger (EventBeforeInsert) that use the WhoID of the event to do other things, it works perfectly in the classic but in lightning this particular field is null in my code although the ...
7
votes
3answers
15k views

Null check OR isEmpty Check

I have checked many posts but still not clear. A SOQL query returns a list but if SOQL finds no records then it will return an empty list or it will be null? When should i go for isEmpty check or ...
0
votes
2answers
504 views

How To Verify that a List/Field is not empty?

These are the methods I use to check if a field is empty: p.Call_Summary__c != null p.Call_Summary__c!='' And these are the methods to check that a list isn't empty: CClist != null CClist.isEmpty(...
1
vote
1answer
5k views

Salesforce Flow : Check for null value in custom lookup field

I have a flow that I'm triggering via Process Builder on the Opty Line Item object. The flow currently creates a new Opty and then updates a custom field on the original Opty Line Item with that new ...
3
votes
0answers
223 views

Why is an empty apex:attribute neither null nor blank but still an empty string?

Consider this simple component: <apex:component access="public" layout="none"> <apex:attribute name="myString" type="String" /> {!ISNULL(myString)} {!ISBLANK(myString)} {!...