Four Stars

Deleting Sales Force Records Prior to insert

Hello!  I am relatively new to Talend.  I have successfully created a job that pulls filtered data from our AS400 and inserts into a custom Sales Force object in my Sandbox environment.  Now I need to create a step that deletes all records in the Sales Force custom object before the insert.  I was able to find several posts regarding this topic however none had solutions. So far I have a tSalesforceOutput component with the Output Action = DELETE.  Next is a tLogRow component (so I have a list of the record Ids).  Then a tSalesforceInput component.     I can execute the job without error but no records are deleted in Sales Force.  

 

Any assistance would be greatly appreciated.

 

cjsigler

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Nine Stars TRF
Nine Stars

Re: Deleting Sales Force Records Prior to insert

Hi,

You must know Salesforce Id for records you want to delete.

So, you need a tSalesforceInput to select these Id, then using tSalesforceOutput (or tSalesforceOutput if lot of records) you can delete the selected records. Just be careful to have Id as the only field in the schema for both components.

Here is the minimal job design for such a case:

tSalesforceInput --> tSalesforceOutput

 

Can you share your job?

 


TRF
7 REPLIES
Nine Stars TRF
Nine Stars

Re: Deleting Sales Force Records Prior to insert

Hi,

You must know Salesforce Id for records you want to delete.

So, you need a tSalesforceInput to select these Id, then using tSalesforceOutput (or tSalesforceOutput if lot of records) you can delete the selected records. Just be careful to have Id as the only field in the schema for both components.

Here is the minimal job design for such a case:

tSalesforceInput --> tSalesforceOutput

 

Can you share your job?

 


TRF
Four Stars

Re: Deleting Sales Force Records Prior to insert

So it sounds like I have my components backwards.  Not sure how to share the job so here is an image.

Untitled.png

 

 

Nine Stars TRF
Nine Stars

Re: Deleting Sales Force Records Prior to insert

Right, can you also share the schema for bot tSalesforceInput and Output components?
Also, does the tSalesforceInput select at least 1 record?

TRF
Four Stars

Re: Deleting Sales Force Records Prior to insert

Like this?

Untitled1.png

Four Stars

Re: Deleting Sales Force Records Prior to insert

That worked!!  I had my components backwards!  Thanks so much!!

Four Stars

Re: Deleting Sales Force Records Prior to insert

Untitled3.png

Nine Stars TRF
Nine Stars

Re: Deleting Sales Force Records Prior to insert

That's what I was going to tell you.

For best practice allways design your jobs from left to right and top to down.


TRF