function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
oleg.tuchschereroleg.tuchscherer 

Enable external sharing updates only "LastModifyDate" ?

Hi,

 

we use Salesforce-to-salesforce feature successfully.

A new trigger must be implemented on Account.

This trigger has

* to start when an Account is transferred by S-to-S (Button "External sharing" was clicked)

* and to update all related objects, like Opportunity and some Custom Objects .

 

Why Account trigger? -> because where is no possibility to place a trigger for "PartnerNetworkRecordConnection" Object.

I did some tests and found out, that the "LastModifiedDate" field on Account is updated when "External Sharing" was clicked. No other Data is changed. 

 

QUESTIONS:

-------------------------

1) Do we realy have no other fields which are being updated by the system ? Or do we have possibly a flag on Account that set to e.g. "true" when Account is transferred by S-t-S?

2) Will the "AFTER UPDATE" trigger execute, when just "LastModifidDate" is changed?

 

Thanks!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Deepa.B.AnkaliDeepa.B.Ankali
@o2,

You can make use of ConnectionHelper.getConnectionId method to fetch connection id and store in a variable. Then query for Account having ConnectionReceivedId not null. For more information, check this link :

http://wiki.developerforce.com/page/Best_Practices_for_Salesforce_to_Salesforce

All Answers

oleg.tuchschereroleg.tuchscherer

to 2) just did some tests: Account Trigger does not start when button "Forward this Acount" is clicked.

Deepa.B.AnkaliDeepa.B.Ankali

@o2,

 

I am not sure but still think that trigger wont be fired on change of lastmodified date. You can have a flag in use for this functionality.

Check this link for more information : Operations that Don't Invoke Triggers

oleg.tuchschereroleg.tuchscherer

that is great problem.

How can identify if an Account is transferred to the other org by S-t-S when "Forward this Account" is clicked?

Deepa.B.AnkaliDeepa.B.Ankali
@o2,

You can make use of ConnectionHelper.getConnectionId method to fetch connection id and store in a variable. Then query for Account having ConnectionReceivedId not null. For more information, check this link :

http://wiki.developerforce.com/page/Best_Practices_for_Salesforce_to_Salesforce
This was selected as the best answer