• suyog dongaonkar
  • NEWBIE
  • 40 Points
  • Member since 2012
  • Salesforce.com Certified Force.com Advanced Developer

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello All,

I have this following requirement


a) A custom button to be exposed

b) Upon clicking the button, I need to verify whether the current record is already present in a custom object

c) If the match is found I need to call TIBCO

d) If the match is not found, then I need to popup a message

Can someone point me in a direction as to how to proceed ?.

Thanks for your time !!!
Hello All,

I have to wite a Trigger on a Object Override which has a lookup to Contract Object. When a new override is created it should check all the override already existing on the contract and make them inactive. The one which is created latest should be active...
Any help is appreciated.

Many Thanks!
Hi All,

I'm new to the Apex side of things and creating Triggers so hoping someone can help.. Here's the scenario; I'd like to automatically update a custom field on a Contact when a custom field relating to Task (ActivityHistory) has a value assigned (1-5). The custom field on the Task is populated based on the Subject content of the completed Task. For example, an email comes in with the Subject of "1 star", the custom field for the Task updates with the value 1, I'd like the custom field on the Contact to also update to read the value 1.

I saw on another post this code but I'm wondering how I need to manipulate it for the above.

Many thanks in advance.


trigger UpdateOpptyIndicator on Opportunity (after insert,after update) {
    System.Debug('ENTERED INTO TRIGGER');
   Contact con,oldCon;
    if (trigger.isInsert) {
    System.Debug('INSIDE ISINSERT');
        if(trigger.isUpdate)
        {
           
        }
        else
        {
            for(Opportunity opp : trigger.new) {
                con=[Select id,Opportunity_Indicator__c from Contact where id=:opp.Contact__c];
                if(con.Opportunity_Indicator__c != null)
                    con.Opportunity_Indicator__c = con.Opportunity_Indicator__c + 1;
                else
                    con.Opportunity_Indicator__c = 1;
                    System.Debug('First Place');
                    update con;
            }
        }
  }
  else {
      System.Debug('INSIDE ISUPDATE');
      if(trigger.isUpdate)
      {               
                for(Opportunity opp : trigger.new) {
                    Opportunity oldOpp = Trigger.oldMap.get(opp.id);
                    System.Debug('OLD OPPORTUNITY :' + oldOpp.Contact__c);
                    System.Debug('NEW OPPORTUNITY :' + opp.Contact__c);
                    if(opp.Contact__c != oldOpp.Contact__c) {
                        con=[Select id,Opportunity_Indicator__c from Contact where id=:opp.Contact__c];
                        System.Debug('PREVIOUS VALUE :'+ con.Opportunity_Indicator__c);
                        if(con.Opportunity_Indicator__c != null)
                            con.Opportunity_Indicator__c = con.Opportunity_Indicator__c + 1;
                        else
                            con.Opportunity_Indicator__c = 1;
                           
                        System.Debug('NEW VALUE :'+ con.Opportunity_Indicator__c);
                        update con;
                        Contact con1 = [Select id,Opportunity_Indicator__c from Contact where id=:opp.Contact__c ];
                        System.Debug('AFTER DATABASE UPDATE :'+ con1.Opportunity_Indicator__c);
                        break;

                    }
                   
                      //System.Debug('Second Place');
                 }
      }
  }
/* try{
        update con;
     }catch(Exception e){
        System.debug('Exception Ocurred'+e.getMessage());       
    }*/

}
Hello All,

I have this following requirement


a) A custom button to be exposed

b) Upon clicking the button, I need to verify whether the current record is already present in a custom object

c) If the match is found I need to call TIBCO

d) If the match is not found, then I need to popup a message

Can someone point me in a direction as to how to proceed ?.

Thanks for your time !!!