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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
TRF
Champion II
Champion II

Workarounds for tSalesforceOutputBulkExec NPE in case of empty flow

With TDI 6.3.1, having an empty flow as input cause tSalesforceOutputBulkExec to fail with a null pointer exception.
It was not the case with 6.2.x and previous versions.
 
Fortunately, there is at least 2 workarounds I want to share with anyone concerned by Salesforce integration.
 
1- store the flow in a tHashOutput, then link it to a  tHashInput with a conditional link and finally, link the tHashInput  to tSalesforceOutputBulkExec:
  0683p000009LuTr.png
The conditional expression is the following:
((Integer)globalMap.get("tHashOutput_12_NB_LINE")) > 0
Use this workaround for a flow of limited size else you risk to encounter a memory exception.
Also tick the "Clear cache after reading" option for tHashInput component if you don't need to reuse the content anymore after this operation.
 
2- replace the tSalesforceOutputBulkExec component by a tSalesforceOutputBulk linked to a tSalesforceOutputExec with a conditional link:
0683p000009LuQ3.png
 
In this case, the conditional expression is:
((Integer)globalMap.get("tSalesforceOutputBulk_1_NB_LINE")) > 0
No limitation regarding the flow size with this solution as tSalesforceOutputBulk use a file (the same as for tSalesforceOutputBulkExec), so you may prefer it if you have to manage huge flows.
 
Advantage, for these 2 solutions compared to tSalesforceOutputBulkExec is you have fewer calls to the Salesforce Bulk API (because you will not make calls for empty flows anymore).
 
Hope this will help you.
Labels (3)
1 Reply
vapukov
Master II
Master II

really not only tSaleForce have problems with empty flow, many components have similar "issue"

 

I use second way - count records (or check file exists in some cases) + runIf trigger