0

Here is my use case. I am syncing records between two orgs using Jitterbit. I select Users from orgA and create Contacts in orgB. Pretty straight forward and this is working.

My challenge is that there is a relationship that I want to create in OrgB. Contacts have a Manager Lookup where the manager is also a contact. On Insert\Upsert the "Manager" may not exist when the "Contact" record is Inserted\Upserted.

What I would like to do is.

  1. Complete my batch upsert.
  2. Wait for the batch to finish and then for each record that was upserted lookup the newID for the manager and set it on the Contact.

Part of my data includes this relationship from orgA so I know the ID of the manager, I was hoping that I could do an after insert\upsert, use the ID from OrgA to lookup the ManagerID in OrgB where OrgAID = "managerID from upsert" and set that as the manager ID?

Does that make sense? Any suggestions?

0

Given that the initial process is a batch upsert that is done externally through Jitterbit, I would not use a trigger for this.

Instead when you upsert the records, store the manager IDs as an external ID. Then you can write a separate batch process to link the records using the external ID field and either schedule it to run after the first batch process should be finished or create an apex endpoint to trigger the batch to run and have Jitterbit call that endpoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.