Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Parikhharshal
Creator III
Creator III

Salesforce Row count

Hi Talend Experts

 

I need your help please.

 

I am trying to get row count from TSalesforceInput component (where I have simple query like SELECT Id from TableA) and trying to capture using NB_LINE. The code for NB_Line is written in JAVA3 component 

System.out.println(((Integer)globalMap.get("tSalesforceInput_2_NB_LINE")));

but instead of showing me total counts...... it prints Null ....Null...... My flow is simply like below:

 

0683p000009M09b.png

 

What do I do to get row counts so that I can compare with target counts too?

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Your job should look like this one:

0683p000009Lzvt.png

It compiles and works fine.

View solution in original post

12 Replies
TRF
Champion II
Champion II

The behaviour is normal as tJavaRow is executed for each row of the flow while NB_LINE is an "after" variable (populated when corresponding component terminate).
Add a tJava connected to your tSalesforceInput by an onSubjobOK trigger and move your println in this component.
Parikhharshal
Creator III
Creator III
Author

Hi TRF

Thanks a lot for your reply. I cannot seem to create onSubJobOK or ComponentOK from Salesforce component to Tjava. May it is not possible?

Thanks
Harshal.
TRF
Champion II
Champion II

Sure it is.
Verify the component is a tJava, not a tJavaRow.
Parikhharshal
Creator III
Creator III
Author

Aah...Bugger off....I was using Tjavarow component.

This brings me to another ques. What's difference between Tajavarow and Tjava?
TRF
Champion II
Champion II

Thank's to mark your case as Solved.
See this link for differences between tJava components https://community.talend.com/t5/Design-and-Development/What-is-the-difference-between-tJava-tJavaRow...
Parikhharshal
Creator III
Creator III
Author

As soon as I changed it to Tjava it gives me an error at salesforce component for some reason.

org.talend.components cannot be resolved to a type. Any idea?
TRF
Champion II
Champion II

Share the new design
Parikhharshal
Creator III
Creator III
Author

0683p000009M0Fs.png

TRF
Champion II
Champion II

Share also tJava code and remove tLogRow (or connect it to tSalesforceInput)