• ApexNewb2012
  • NEWBIE
  • 0 Points
  • Member since 2012

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

HEllo I was wwondering how i can get my XML response from Salesforce to Include the Id where it errors out?

 

I get the Id when it is a success for each success but not for errors? I am running my process through Pervasive..

Hello All,

 

I am new to writing Apex and am having trouble writing a trigger. I have two Objects 1) Standard Account Object and 2) Sales Reps custom Object.   I am attempting to have the trigger update all accounts in which a certain field (SalesRep#) matches the custom object field (rep Id).  On the custom object the Owner can change of the rep id. On the standard Object field there is a trigger in place that will update an account correctly once it is edited but not if the Sales rep object changes. I pretty much just need the trigger to fire to update those accounts so the second trigger can fire. But another issue i will have is updating all records which already exist and have this issue currently.

 

this is what i wrote but does nothing

 

trigger  SalesRepID on SRID__C  (before insert, before update){

  List<String> SRIDS = New List<String>();

  for(SRID__c S : Trigger.new){
    if(S.Name != null){
      SRIDS.add(S.Name);
    }
  }

  List<Account> AcctList = [SELECT Id  FROM Account WHERE SLS_1__C in :SRIDS];
    for(integer i = 0 ; i < AcctList.size(); i++){
     AcctList[i].SLS_1__c = '0???';
  }

  update AcctList;
}

HEllo I was wwondering how i can get my XML response from Salesforce to Include the Id where it errors out?

 

I get the Id when it is a success for each success but not for errors? I am running my process through Pervasive..