Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Null CreatedDate from Salesforce

I have create a job for Salesforce and Oracle DB Integration via tMap. However i am always getting created date as null in DB and also in tLogRow whereas data is updated properly for LastModifiedDate.

 

I have also tried using below logic to check if the Date is actually null or being missed because of wrong formatting.

row1.CreatedDate != null ? row1.CreatedDate : TalendDate.getDate("yyyy-MM-dd")

 

As a result i am always getting today's data in the DB.

 

Warm Regards,

Ankit Singh

Labels (2)
4 Replies
lennelei
Creator III
Creator III

Hi,

 

I don't have a solution for your problem yet but I have some remarks.

 

The following code shouldn't work in the tMap :

row1.CreatedDate != null ? row1.CreatedDate : TalendDate.getDate("yyyy-MM-dd")

According ro your screenshot, both row1.CreatedDate and CREATION_DATE are Date objects while TalendDate.getDate("yyyy-MM-dd") returns a String.

 

This code cannot work and you should have a "Type mismatch: cannot convert from String to Date" error message!

 

Assuming this is not exactly the code you have in your job, and that you have something like this instead:

row1.CreatedDate != null ? row1.CreatedDate : TalendDate.getCurrentDate()

Then, if you have the current date as output, it probably means you have null values as inputs!

 

Did you try to add a tLogRow before the tMap in order to see the actual values?

 

Regards

TRF
Champion II
Champion II

Having null values for CreatedDate and LastModifiedDate Salesforce fields is just not possible.

Share your job design + details for the tSalesforceInput component.

lennelei
Creator III
Creator III

Of course it's possible to have null value before using the second option with ternary operator!

TRF
Champion II
Champion II

No.

On salesforce side CreatedDate and LastModifiedDate fields are never null (like id, owner and some others).

So when you get records from salesforce, these fields are allways populated.

If you have null, you have a bug somewhere.

For example, if you enter the SOQL query by yourself, it may arrives if you write createDate instead of CreatedDate in your schema (and the job will not fail).