March 11, 2015
In SF there are two objects responsible for S2S connection: PartnerNetworkConnection – keeps all information about current connection and PartnerNetworkRecordConnection – holds information about record that was forwarded. I will not write here how to create S2S connection, there is a lot of information about in internet. We will talk about forwarding objects that are already published and subscribed in both orgs. We can forward objects in two ways: manualy in page or in code. Below is sample of class to do this in code:
Note: if there will be an error, in upserting one the record, all bunch will not be forwarded.
Also we do not need to forget about Salesforce Governors and Limits. Because if we have triggers and some logic on forwarded records, in partner org, we can hit them. In this case we will not get error on Connection history, but all upserted PartnerNetworkRecordConnections will have status “Pending (sent)” and will not be forwarded.
To be able to forward records again we need to change status of PartnerNetworkRecordConnection from “Pending (sent)” to “Inactive”. To do this we need to delete PartnerNetworkRecordConnection, but it will not be deleted, it will just change status to “Pending (sent)”. After this we can insert tham again. If there will not be any errors, status will change to “Active (sent)” or “Connected” in several seconds. So if we need to change something in PartnerNetworkRecordConnection, we need to delete it and insert/upsert it again. This is strange way to work with, but it is only way.
One more thing. When we are forwarding records and filling in field ParentRecordId, we need to be sure that parent record is already forwarded, in other case we will have an error.
September 22, 2017
As everyone is aware, over the first half of September, Hurricane Irma brought huge devastation to the Caribbean and Florida, with islands all but destroyed and more than 6 million Floridians lacking power.
September 15, 2017 | Andrew Petryk
According to the latest Tiobe index of programming language popularity, Java tops the list. No wonder there is so much buzz around the new Java 9 release, set for September 21, 2017. Take a walk through with our expert. 1. JSHELL Many compiled languages include tools for statements interpretation. By using these REPL tools […]