• Miki Nagikawa
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
We have a company that we are connected by Salesforce to Salesforce. And that company mapped their Opportunity Name to us, but we did not map back since they did not want our their Opportunity Name to be same as ours. but the problem occurs, when they modify the shared opportunities because it reverts back to their Opportunity Name and we want to keep ours. Can someone help me, I need to make "unmap" the Opportunity Name after it is connected. Can it be done by a workflow or a trigger?
I have a list of values in one picklist field (A) and would like to have some of those values (abc, dfe) trigger to update another picklist field's (B) value (xyz) upon selection. The reason i would like to use Apex is because I have a field dependency already used for those fields and cannot overwrite it with another dependency. Any suggestion? I am new to apex and I have trouble creating the trigger.
I have a list of values in one picklist field (A) and would like to have some of those values (abc, dfe) trigger to update another picklist field's (B) value (xyz) upon selection. The reason i would like to use Apex is because I have a field dependency already used for those fields and cannot overwrite it with another dependency. Any suggestion? I am new to apex and I have trouble creating the trigger.
Hi,

i am trying to auto push records from one org to another and i have written a trigger on Opportunites and it is working good when the condition is met it is autopushing Opportunites but now i want to push related account and contacts how can i do this

Trigger autoforwardOpportunity on Opportunity(after insert)
{
String UserName = UserInfo.getName();
String orgName = UserInfo.getOrganizationName();
List<PartnerNetworkConnection> connMap = new List<PartnerNetworkConnection>(
[select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection where ConnectionStatus = 'Accepted']
);
System.debug('Size of connection map: '+connMap.size());
List<PartnerNetworkRecordConnection> prncList = new List<PartnerNetworkRecordConnection>();
for(Integer i =0; i< Trigger.size; i++)
{
Opportunity acc = Trigger.new[i];
String acId = acc.Id;
System.debug('Value of OpportunityId: '+acId);
for(PartnerNetworkConnection network : connMap)
{
String cid = network.Id;
String status = network.ConnectionStatus;
String connName = network.ConnectionName;
String AssignedBusinessUnit = acc.Assigned_Business_Unit__c;
System.debug('Connectin Details.......Cid:::'+cid+'Status:::'+Status+'ConnName:::'+connName+','+AssignedBusinessUnit);
if((AssignedBusinessUnit!=Null)&& AssignedBusinessUnit.equalsIgnoreCase('IT')  )
{
PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
newrecord.ConnectionId = cid;
newrecord.LocalRecordId = acId;
newrecord.SendClosedTasks = true;
newrecord.SendOpenTasks = true;
newrecord.SendEmails = true;
System.debug('Inserting New Record'+newrecord);
insert newrecord;
}
}
}
}
  • February 10, 2014
  • Like
  • 0