• JonathanMClarke
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

Currently have the following trigger which works perfectly for one record inside our production organization:

 

trigger createCommissionClosedWon on Opportunity ( before insert, before update) {
    Opportunity[] opps = Trigger.New;
    for (Opportunity o:opps){
    If (o.StageName == 'Closed Won')
       CreateCommissionRecords.createCommissionRecords(opps);
}}

 I'm trying to bulkify this trigger so that it performs well under bulk updates..... The following code creates an error when I try and save:

 

trigger createCommissionClosedWon on Opportunity (before insert, before update) {

    for (Opportunity opps: Trigger.New){
    	If (opps.Stage == 'Closed Won'){
   		CreateCommissionRecords.createCommissionRecords(opps);
}}}

 What am I doing Wrong??? This is the error message that I'm receiveing: Save error: Method does not exist or incorrect signature: CreateCommissionRecords.createCommissionRecords(SOBJECT:Opportunity)  

 

it sounds like a variable / definitional problem.... Thanks so much for helping me.....

 

 

 

Hi all,

 

How to use JQuery in salesforce.com?

 

Cann you please provide any pdf with Examples

 

Thanks for your help.......



I've built the warehouse application in the force.com workbook and all is stored in my company's sandbox. The application is finished and I'd like to transfer it to my production organization; however, have received the following error and do not know how to rectify....

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.MassUpdateSimpleController.value: line 111, column 25 Class.MassUpdateSimpleControllerTest.singleUpdateTest: line 33, column 6 External entry point.

Hi,

 

Can someone help, I keep getting the error:

System.DmlException: Insert failed. First exception on row 0 with id 00oS0000000AOgYIAW; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

 

But I am pretty sure that there is no Id specified in my insert call.

Here is my code:

 

 

public PageReference save() { List<OpportunityLineItemSchedule> revenueSchedulesToUpdate = new List<OpportunityLineItemSchedule>(); List<OpportunityLineItemSchedule> revenueSchedulesToInsert = new List<OpportunityLineItemSchedule>(); for(revenueSchedulesDate revenueSchedulesDate:revenueSchedulesDates){ for(OpportunityLineItemSchedule revenueSchedule:revenueSchedulesDate.getRevenueSchedules()){ if(revenueSchedule.get('Id') == null) revenueSchedulesToInsert.add(revenueSchedule); else revenueSchedulesToUpdate.add(revenueSchedule); } if(revenueSchedulesToUpdate.size() > 0) update revenueSchedulesToUpdate; if(revenueSchedulesToInsert.size() > 0) insert revenueSchedulesToInsert; } return Page.revenueScheduleView2; }