SalesForce adding external Id to output

One Star

SalesForce adding external Id to output

Hi,
I've a simple question, on a SalesForce connection (but it's not important).
Let's suppose I've the following csv to import (AccountImport):
- External_Id
- Name
I've to write in an object who have a lookup on account (MyObj):
- Account__c
- Name
Before I do the mapping, I made a lookup to retrive the record Id instead of External_Id to correct write in destination Object (MyObj).
When I have the waste record to write the log, I would to obtain the reference to external Id and not to the original Id.
The chain is:
tSalesForceInput (Account)/ tFileInputDelimited --> tMap --> tSalesForceOutput --> tFileOutputDelimited (error record)
How I can do?
Thank you.
Moderator

Re: SalesForce adding external Id to output

Hi,
Could you please elaborate your case with an example with input and expected output values? It seems that you have two input sources?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

Hi,
I try to give you details:
INPUT
CSV to import
- External_Id
- Name
Lookup object (Account)
- External_Id
- Id
OUTPUT
Write on MyObj
- Account__c (id of account, not external id)
- Name
In MyObj I've to write the Id of account, not the external. But in the csv I've the external, so I made a lookup on Account.
I wish a output log who shows error for the record in the following form:
-ExternalId (not Id)
-Name
-Error (or similar)
Thank you,
regards
Moderator

Re: SalesForce adding external Id to output

Hi,
Do you mean you want to get the "Error Reject"
Please see the article ErrorReject? If I understand you very well, you can set a inner join in tMap and unchecked "die on error" option to get the "Error Reject".
See my screenshot
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

Hi Sabrina,
many thanks for you help.
This seems to be the solution for me.
I'm obtained the error reject, But I don't understand how to map an output file who, at every error, log the message.
Here's my real situation: http://s21.postimg.org/6hh0qtpjb/img_t.jpg
Regards.
Moderator

Re: SalesForce adding external Id to output

Hi,
But I don't understand how to map an output file who, at every error, log the message.

I have seen your pic and found there is only one output(Account team). Do you mean you want to log the error into your tfileoutputdelimted_2? If so, you just click tMap and choose "Error Reject" row.
See my pic
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

Hi Sabrina,
that's ok, I found this solution few minutes ago.
Now the missing step is that in ErrorReject no record are processed.
In input I've 4 record, and in output only 1 of them (the correct one) is processed and inserted. The other 3 (error) are not stored in the output file.
I'm sure I'm near to the goal!
Thank you.
One Star

Re: SalesForce adding external Id to output

Unfortunately I figured that this is not the solution for me.
This is because I don't care to have the error in the mapping, but only when the record are inserted in the database.
This is because I need to view the error managed by the remote system (SalesForce).
This is possible?
Thanks.
Moderator

Re: SalesForce adding external Id to output

Hi,
This is because I don't care to have the error in the mapping, but only when the record are inserted in the database.
This is because I need to view the error managed by the remote system (SalesForce)

Talend provide global variables in the process.
Press ctrl+space to access all the global variables, is that what you need?
See the pic
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

Hi,
At the end of process, I need a log file with each record inserted and the error message.
The procedure you suggest is for the error in the component?
Thank you.
Moderator

Re: SalesForce adding external Id to output

Hi,
The "NB_LINK" global variables is used to count the total number of records have been proceed. Not the detailed info about which record is inserted successfully or not.
The "ERROR_MESSAGE" global variables is used to log the error in this component. If there is no error in current component, it will show "null".
For your requirement, it seems that you need the rejected record by tSaleforceOutput. If so, please uncheck the "Extend Output" option in Advanced Setting and you will get the "Reject" row from tSaleforceOutput.
See my screenshot
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

_anthony_ : Have you considered simply making a lookup table for the id's? You just store the external and internal id's somewhere and look up the one you need when you get it.
Not sure exactly how you can do that most efficiently in Talend, but it's possible in many ways.
Moderator

Re: SalesForce adding external Id to output

Hi _anthony_,
Is there any update for your issue? Feel free post your issue on forum.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: SalesForce adding external Id to output

Hi,
now I've partially solved my issue using the bulk output apex.
But I can't obtain the external Id.
Thnak you.
Moderator

Re: SalesForce adding external Id to output

Hi,
Could you give us your new design workflow screenshot? Did you add the External_Id into output?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.