• IoniaCorp
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
Is there a way to get the day(sunday,Monday.....) from the given date.
urgent help needed. any idea will be appreciated.
I am trying to create an additional task if the status of the current task is "Left Message". The new task will be identical except its status will be "Not Started", and due date will be different one.
My sample code is as follows:

*****************
trigger CreateNewIfStatusChangedToLeftMessage on Task (after insert,after update) {

for (Task t : Trigger.new) {    
         
     if (t.Status=='Left Message')
     {                      
        Task task = new Task(
                   //WhoId = t.WhoId,
                  // Owner = t.Owner, 
                  // What = t.What,                                               
                   Description = t.Description,
                   Priority = t.Priority,
                   ReminderDateTime = System.now().addDays(2),
                   ActivityDate = System.Today(), //should be different from the current one
                   Status = 'Not Started',
                   Subject = t.Subject);
                 
                   insert task;           
                  
        System.debug('Additional Task Created') ;  
      }
      else
      {
         System.debug('Status: ' + 'Not changed.' ) ;    
      }
 
  }
}
***************************
From the debugging message  the additional task seems to be created. But I am unable to see the new task under the page where I started creating the task. I can see only one task created, not both of them.

Any suggestion will be appreciated.

Thank you.
I have a requirement to add campaign history to the existing Lead. I want to create a new lead, if there is a lead/contact with the same e-mail I want to mark this new lead as DUPLICATE and want to update existing Lead/Contact  with the new Campaign and the other new field values.
Any clue will be appreciated.
I am trying to carry out a bulk operation in my trigger. But I am getting the following error:

---------------------------
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger UpdateContract caused an unexpected exception, contact your administrator: UpdateContract: execution of AfterUpdate caused by: System.Exception: Too many DML rows: 484: Trigger.UpdateContract: line 25, column 5
---------------------------

The problem is due to large number of objects to be updated.

Any suggestions will be appreciated.
I want to cancel the Lead INSERT event in case there is another Lead from the same source(e.g. with same e-mail address) and update the old Lead with the required information. In other words I want to create a new Lead only in case there is not existing one in the system from the same source.

I tried with the combinations of update, insert triggers but got  errors. Is there a functionality of Instead of Trigger in salesforce?

Any suggestions will be appreciated.


I have the following requirement -

I have an object(Student) that has two fields: one CheckBox type and other Text type (scenario - Pass/Fail status and Student Name).
What I am trying to do is get the student object information in the visualforce page in updatable mode. Check/Uncheck one or more student record(s) and carry out the required operation with the help of a custom button(e.g. select students named name1, name3,name5 and change their Pass/Fail status to Pass by clicking the button Change status to Pass) at once.

Any suggestions will be appreciated.

Thanks in advance.
I am trying to create an additional task if the status of the current task is "Left Message". The new task will be identical except its status will be "Not Started", and due date will be different one.
My sample code is as follows:

*****************
trigger CreateNewIfStatusChangedToLeftMessage on Task (after insert,after update) {

for (Task t : Trigger.new) {    
         
     if (t.Status=='Left Message')
     {                      
        Task task = new Task(
                   //WhoId = t.WhoId,
                  // Owner = t.Owner, 
                  // What = t.What,                                               
                   Description = t.Description,
                   Priority = t.Priority,
                   ReminderDateTime = System.now().addDays(2),
                   ActivityDate = System.Today(), //should be different from the current one
                   Status = 'Not Started',
                   Subject = t.Subject);
                 
                   insert task;           
                  
        System.debug('Additional Task Created') ;  
      }
      else
      {
         System.debug('Status: ' + 'Not changed.' ) ;    
      }
 
  }
}
***************************
From the debugging message  the additional task seems to be created. But I am unable to see the new task under the page where I started creating the task. I can see only one task created, not both of them.

Any suggestion will be appreciated.

Thank you.
I have a requirement to add campaign history to the existing Lead. I want to create a new lead, if there is a lead/contact with the same e-mail I want to mark this new lead as DUPLICATE and want to update existing Lead/Contact  with the new Campaign and the other new field values.
Any clue will be appreciated.
I have the following requirement -

I have an object(Student) that has two fields: one CheckBox type and other Text type (scenario - Pass/Fail status and Student Name).
What I am trying to do is get the student object information in the visualforce page in updatable mode. Check/Uncheck one or more student record(s) and carry out the required operation with the help of a custom button(e.g. select students named name1, name3,name5 and change their Pass/Fail status to Pass by clicking the button Change status to Pass) at once.

Any suggestions will be appreciated.

Thanks in advance.