• EMORAN
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hello, I have a connection between two instances, one of them is a trigger that validates the account. When I want to forward the information I want to show the error that occurs in the second org.

 

This is the trigger that generate the forward to the second ord when i insert the account:

 

trigger tr_ShareExternalRow on Account (after insert) 
{
	if(Trigger.isAfter)
	{
		List<PartnerNetworkConnection> connMap = new List<PartnerNetworkConnection>(
	    [select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection
	    where ConnectionStatus = 'Accepted']);    
	    
	    for(Account cuenta:Trigger.new)
	    {
		
			if(cuenta.ConnectionSentId==null)
			{
			    for(PartnerNetworkConnection network : connMap)
			    {
			    	PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
				    newrecord.ConnectionId = network.Id;
					newrecord.LocalRecordId=cuenta.Id;
					
			    	insert newrecord;	
					   	
			    	
			    } 
			}   
	    }  
	}
	
}

 

This is the trigger in the second org that validate the account exist, if exist trigger the error:

 

trigger tr_Validate_RFC_Account on Account (before insert) 
{
	Set<String> setRFC =new Set<String>();
	
	for(Account cuenta:Trigger.new)
	{
		setRFC.add(cuenta.RFC__c);
	}
	
	List<Account> lcuentas=[Select id,RFC__c from Account where RFC__c IN:setRFC];
	
	for(Account cuentasTrigger:Trigger.new)
	{
		for(Account cuentasRFC:lcuentas)
		{
			if(cuentasTrigger.RFC__c==cuentasRFC.RFC__c)
			{
				cuentasTrigger.addError('Account Exist');
			}
		}
	}
}

 

I want show in addError('Account Exist') in the first org.

 

Greetings.

 

  • November 08, 2012
  • Like
  • 0

my <apex:datatable> has multiple columns containing input field ... selectList...

is it possible to sort my table when header is clicked ??

and if yes... which is best way..using controller function or jquery plugin ??

i have tried tableSorter plugin but its not working properly.....

  • March 12, 2013
  • Like
  • 0