Questions tagged [null]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14
votes
4answers
24k views

What Criteria to use in Process Builder to check for NULL reference?

I have a lookup field on account - for other accounts - Name: Account Parent Tiered OBJ How do I check in Process Builder that it's actually empty? Using the Global Constant NULL or: IS Null true ...
10
votes
4answers
765 views

Can apex:param pass null for Integers?

I'm trying to reset an Integer value to null, but it is converted to 0. <apex:actionFunction action="{!doSomething}" name="doSomething" rerender="nothing"> <apex:param name="indexValue" ...
9
votes
2answers
903 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){ ...
7
votes
3answers
11k 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 ...
5
votes
2answers
17k 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 ...
5
votes
1answer
128 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 ...
4
votes
1answer
301 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 ...
3
votes
3answers
778 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));...
3
votes
1answer
300 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
1answer
3k views

RestContext.request.params.get gives null value for Test Class

RestContext.request.params.get gives null value for Test Class Following is my code and Debug logs : APEX CLASS : String accountRecordId= RestContext.request.params.get('accountRecordId'); ...
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 ...
3
votes
1answer
352 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 ...
3
votes
0answers
201 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)} {!...
2
votes
3answers
2k 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&...
2
votes
1answer
154 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
2answers
939 views

Assertion failure that a null pointer exception is caught

I am doing some test code right now. In my Apex code I have a method that try-catches a DMLException and afterwards does a general Exception catch. In my test code I am successfully managing to test ...
2
votes
2answers
26 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; ...
2
votes
1answer
59 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
77 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 ...
1
vote
2answers
406 views

Trigger will not fire, picklist value always returns null

In an apex "before update" trigger, I have a conditional statement based on a picklist value. However, this conditional statement never fires because the picklist value always returns null. trigger ...
1
vote
1answer
416 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 ...
1
vote
2answers
618 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" ...
1
vote
2answers
45 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&...
1
vote
2answers
5k views

Filter NULL values in reports?

How can I filter out NULL values from within the reports editor for a text field?
1
vote
2answers
513 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 ...
1
vote
2answers
43 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>(); ...
1
vote
1answer
76 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
146 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
27 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 ...
1
vote
1answer
3k 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 ...
1
vote
2answers
1k views

get Attempt to de-reference a null object on wrapper class

i get this error when i click on the Commandbutton Enregistrer, i debug the code and i realized that the error comes from the method Enregistrer what i do not know why ? apex: public class ...
1
vote
2answers
61 views

getting system Null reference error

I've been at this for a while and can't seem to figure out why I'm getting the error "System.NullPointerException: Attempt to de-reference a null object" for the "comments.add(com)" line below ...
1
vote
0answers
54 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
0answers
748 views

Recordtype is changing to null

We're facing a pretty serious bug and have no idea what is causing it. Something is causing our opportunity record types to become null. They were a specific record type, and then through the day, ...
1
vote
0answers
103 views

Stop from entering a null value in apex inline edit

I have the following code <apex:outputField value="{!pubAut.AcceptedDate__c}"> <apex:inlineEditSupport event="ondblclick" rendered="{!(pubAut.AcceptedDate__c!=NUll&&pubAut....
0
votes
1answer
65 views

Null values isn't seen as null [duplicate]

I have a text field that has nothing in it. I created a formula to check if it is null, but it keeps coming up that it exists. IF(ISNULL({!textfield}),"Null","Exists") There isn't a hidden space or ...
0
votes
2answers
42 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 ...
0
votes
1answer
284 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
56 views

Attempt to de-reference a null object - Error in sorting list

I am getting subject line - error while I try to execute below apex code snippet Apex Code Snippet for(Integer index = 0; index < surveyInstanceList.size(); index++) { Survey_Question_vod__c ...
0
votes
2answers
57 views

Why am I getting NULL pointer exception in line 14

I have created a simple VF search page which returns a list of email addresses but getting NULL pointer exception in line 14 when I execute the search in VF page. Seeing that line 14 is the line ...
0
votes
1answer
49 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
1answer
63 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
2answers
40 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 ...
0
votes
3answers
49 views

Does list element get removed after deletion of that record from database?

Updated my question: Scenario:I am making certain changes in an opportunity record and clicking save. This causes trigger to execute and this trigger is executed recursively 3-4 times. Now say I have ...
0
votes
1answer
81 views

Attempt to dereference null object error

I have below controller where I get Attempt to dereference a null object error at ProdIds.add(c.id); Line. Error Code public TestController(ApexPages.StandardController stdCtrl) { ...
0
votes
1answer
60 views

Error Attempt to de-reference a null object for test class

For the method below, I have written test class. But getting error at fetchInit f = new fetchInit(); inside the method. Error: Attempt to de-reference a null object. How can I avoid this error. Also ...
0
votes
2answers
25 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 : [...
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(...
0
votes
2answers
338 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(...