function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sam_Adminsam_Admin 

Compile Error in trigger

Hi,

  Am getting this error, do anyone knows how to fix it?

 

Method does not exist or incorrect signature: BigMachinesQuoting.syncQuoteWithOpty(Id, Id) at line 36 column 9

 

trigger promotePrimaryProdToOppty1 on BigMachines__Quote__c (after insert, after update) {

    // There is no standard scenario where multiple quotes are created in one
    // batch operation.  There are standard scenarios where multiple quotes
    // are updated in one batch operation.  This trigger only operates for
    // individual quote creation or multiple quote modification.  If multiple
    // quotes are created at the same time (through the Data Loader, for
    // example) this trigger will not do anything.  This trigger will fire,
    // however, if multiple quotes are updated at the same time.

    //loop through trigger and find primary
    Integer index = -1;
    if (Trigger.isInsert) {
        //if a single quote is being created as primary, sync it with opty
        if ((Trigger.size == 1) && (Trigger.new[0].BigMachines__Is_Primary__c == true)) {
            index = 0;
        }
    } else {
        for (Integer i=0; i<Trigger.size; i++) {
            //loop through all updated quotes
            if ((Trigger.old[i].BigMachines__Is_Primary__c == false) && (Trigger.new[i].BigMachines__Is_Primary__c == true)) {
                //if a quote is changing to primary
                if (index == -1) {
                    // found first primary, mark to sync with opty
                    index = i;
                } else {
                    // found more than one primary, so don't sync with opty
                    index = -1;
                    break;
                }
            }
        }
    }

    if (index >= 0) {
        BigMachinesQuoting.syncQuoteWithOpty(Trigger.new[index].Id,Trigger.new[index].BigMachines__Opportunity__c);
    }
    
}

GanjehGanjeh

Looks like you're passing in a non id value... when the BigMachinesQuoting.syncQuoteWithOpty method is expecting two id parameters.

 

Is BigMachines__Opportunity__c an id value?

sam_Adminsam_Admin

yes it is lookup field to opp in object called Bigmachnes and Id is Bigmachines Id

sai.sfsai.sf

Can you post BigMachinesQuoting class here