• deryck
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I need to deploy the following trigger into production:
 

trigger Call_Room on Case(before insert, before update) {

     Map<Id, Case[]> contactCaseMap = new Map<Id, Case[]>();

     For (Case ncase:Trigger.new) {

        Id cid = ncase.contactId;

        If (cid != NULL) {

            if(contactCaseMap.get(cid) == null) contactCaseMap.put(cid, new Case[]{});

            contactCaseMap.get(cid).add(ncase);

        }

     }

     For(Contact c:[select Call_Room_Number__c from Contact where Id IN :contactCaseMap.keySet()]) {

        for(Case ncase:contactCaseMap.get(c.id)) {

           ncase.Call_Room_Number__c = c.Call_Room_Number__c;

        }

    }

}

 

This is the only thing I need to get into the production environment for an enterprise version system.  I am useing Eclipse.  I am having trouble following the process in the Developer's Guide...can anyone help?

  • March 21, 2008
  • Like
  • 0
I've created a custom field called room_number__c that is located on the Contacts tab.  When a new case is created, I want to have that same field appear in the cases tab and have it pre-populated with the value contained from room_number__c in the Contacts tab.
 
I originally did this using a trigger and some code.  Unfortunately, it seems that after the first thirty days of use, the trigger function seems to go away and no one at salesforce can bring it back for me.  So, I need to find a way to accomplish the creation of fields in one tab and have the data, once populated, appear on the cases tab.
 
Any suggestions?
  • March 18, 2008
  • Like
  • 0
I need to deploy the following trigger into production:
 

trigger Call_Room on Case(before insert, before update) {

     Map<Id, Case[]> contactCaseMap = new Map<Id, Case[]>();

     For (Case ncase:Trigger.new) {

        Id cid = ncase.contactId;

        If (cid != NULL) {

            if(contactCaseMap.get(cid) == null) contactCaseMap.put(cid, new Case[]{});

            contactCaseMap.get(cid).add(ncase);

        }

     }

     For(Contact c:[select Call_Room_Number__c from Contact where Id IN :contactCaseMap.keySet()]) {

        for(Case ncase:contactCaseMap.get(c.id)) {

           ncase.Call_Room_Number__c = c.Call_Room_Number__c;

        }

    }

}

 

This is the only thing I need to get into the production environment for an enterprise version system.  I am useing Eclipse.  I am having trouble following the process in the Developer's Guide...can anyone help?

  • March 21, 2008
  • Like
  • 0