Questions tagged [null]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 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
40 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 ...
2
votes
2answers
24 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
30 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
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&...
0
votes
1answer
172 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
272 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
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 ...
2
votes
1answer
240 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
707 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
48 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
106 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 ...
0
votes
1answer
62 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
14 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
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&...
0
votes
1answer
424 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
147 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
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
71 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
15k 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
157 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
412 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
292 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
5k 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
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 : [...
5
votes
1answer
123 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
573 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
32 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(...
8
votes
2answers
858 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
1k 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
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 ...
3
votes
1answer
330 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
496 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
10k 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
311 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
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 ...
3
votes
0answers
199 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)} {!...
3
votes
1answer
2k 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'); ...
0
votes
1answer
63 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 ...
1
vote
2answers
966 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
0answers
711 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
2answers
60 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 ...
0
votes
1answer
55 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
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 ...
1
vote
2answers
396 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 ...
0
votes
1answer
1k views

Map key null not found in map

I want to render a specific column based on the some conditions, the first is that a flag should be "TRUE" and the second is that the The ids should be the sames, like that, if a click on a specific ...
10
votes
4answers
730 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" ...
0
votes
2answers
304 views

<apex: textarea> return null value when trying to pass its value as a prameter

In visualforce, I am iterating through a wrapper class and for each iteration, a textbox is displayed. My code snippet is: <apex:repeat value="{!comList}" var="com"> <b>{!com.comment.name}...