• impalacrazy
  • NEWBIE
  • 0 Points
  • Member since 2012

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

So i have a trigger that takes the information from one title field and pushes it into another. It was working great but we noticed that the following was taking place (here is the example):

 

1. candidate is recruited and title is given in short_title__c  (PA) field

2. record is changed over to credentialing and short_title__c (PA) field is pushed into title__c (PA) field

3. user goes into credentialing record for contact and makes change to title__c (now says PA-C) and any field (last name, address, etc and saves)

4. title__c (PA) and other changes saved

 

So what i was trying to acomplish was that no matter what changes anyone makes to the title or any other field on the contact record that title__c is not over written with what is in short_title__c field. Below is the code

 

trigger setTitle on Contact (before update)
{
for(Contact c: trigger.new)

if(c.Title_Short_List_Job_Board__c != null && c.Title_Short_List_Job_Board__c != trigger.oldMap.get(c.id).Title__c)
{
c.Title__c = c.Title_Short_List_Job_Board__c;
}
}

So fairly new to the apex side of salesforce so hopefully this can even be done.

 

So we have a field called Title which is being used by two group. In salesforce we have it managed so depending on the record type you only see certain titles for the contact. Well our job board does not look at our logic rather it just shows all values in the title field on our job board.

 

So what i am trying to do is create a new title field that only has the 5 main titles we want displayed and have it push into our primary title field when the candidate is created from the job board.

 

i.e. title_2__c = MD >>>>>> when candidate created date is (Today) push title_2__c into Title__c so that

 

title_2__c = MD & Title__c = MD

 

Has anyone done this type of coding before. Or point me in the direction to figure this out...

 

Thanks...

So i have a trigger that takes the information from one title field and pushes it into another. It was working great but we noticed that the following was taking place (here is the example):

 

1. candidate is recruited and title is given in short_title__c  (PA) field

2. record is changed over to credentialing and short_title__c (PA) field is pushed into title__c (PA) field

3. user goes into credentialing record for contact and makes change to title__c (now says PA-C) and any field (last name, address, etc and saves)

4. title__c (PA) and other changes saved

 

So what i was trying to acomplish was that no matter what changes anyone makes to the title or any other field on the contact record that title__c is not over written with what is in short_title__c field. Below is the code

 

trigger setTitle on Contact (before update)
{
for(Contact c: trigger.new)

if(c.Title_Short_List_Job_Board__c != null && c.Title_Short_List_Job_Board__c != trigger.oldMap.get(c.id).Title__c)
{
c.Title__c = c.Title_Short_List_Job_Board__c;
}
}

So fairly new to the apex side of salesforce so hopefully this can even be done.

 

So we have a field called Title which is being used by two group. In salesforce we have it managed so depending on the record type you only see certain titles for the contact. Well our job board does not look at our logic rather it just shows all values in the title field on our job board.

 

So what i am trying to do is create a new title field that only has the 5 main titles we want displayed and have it push into our primary title field when the candidate is created from the job board.

 

i.e. title_2__c = MD >>>>>> when candidate created date is (Today) push title_2__c into Title__c so that

 

title_2__c = MD & Title__c = MD

 

Has anyone done this type of coding before. Or point me in the direction to figure this out...

 

Thanks...