You need to sign in to do that
Don't have an account?
Thylaksoft
Trigger the insertion of Data form one organisation to other organisation
In my case,i want update/insert custom object data from one organisation account to other organisation account.
i have used 'Salesforce to Salesforce' feature,but i am not able to trigger the insertion of data while add data in other shared salesforce object.
Is it possible in salesforce?,If anybody have experienced in the above scenario ,your suggestions are greatly appreciated!
thanks in advance for your reply!!
Did you tried going to "Connections" tab. This tab is available in "View All Tabs" or "from Setup | My Personal Information |Change my Display"
Here you will see a screen to establish connections between orgs and select objects to publish or subscribe. You need to select atleast one object to publish from the source org.
If you have already done so, then "To share a record, you must forward it to a connection using the External Sharing related list. Updates to shared records are sent automatically". For this goto the detail page of the record and check for sharing options in "External Sharing" related lists.
Otherwise if you want to do this via Apex Code. Here is the snippet that explains that, use this in trigger to do so. Here is the source for this info
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_partnernetworkrecordconnection.htm
List<PartnerNetworkConnection)> connMap = new List<PartnerNetworkConnection>([select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection where ConnectionStatus = 'Accepted']);for(PartnerNetworkConnection network : connMap) { PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection(); newrecord.ConnectionId = network.Id; newrecord.LocalRecordId = accountId; newrecord.RelatedRecords = 'Contact,Opportunity,Orders__c'; newrecord.SendClosedTasks = true; newrecord.SendOpenTasks = true; newrecord.SendEmails = true; insert newrecord; }
I am trying to write a complete blog post that explains this in detail. But will take some time.
So by the time check this out and let me know if you have more queries.
I am trying to use this trigger on the Case object. I am getting an Error: Error: Compile Error: Variable does not exist: accountId
Can you tell me what value should go in on this line: newrecord.LocalRecordId = accountId
// not an ideal practice, but follow the best practices for writing triggers.
// just want to show how to declare accountId
Id accountId = trigger.new.get(0) ;