Skip to main content
Hi, I am trying to write a trigger to call a btach class if a check box is true, otherwise call the future class. but IDK what is wrong with my code I can't save it. please advise. here is my code:

trigger ProjectSettings_ChartsTrigger on Project_Setting__c (After Insert,After Update){

    

    List<id> ProjectIds = new list<id>();

    List<Project_Setting__c > prj = [select Id, total_check__c from Project_Setting__c where Id In : ProjectIds];

    for(Project_Setting__c PS : Trigger.new){

    if (Project_Setting__c.total_check__c = true) {

      ProjectIds.add(PS.id);   

    }

    ProjectSettings_ChartsBatchClass pro = new ProjectSettings_ChartsBatchClass(); 

              database.executebatch(pro,2000);

} if (Project_Setting__c.total_check__c = false){

     projectSettingsChartClass.ProjectMethods(ProjectIds);

    }

    

Thanks
7 个回答
  1. 2015年1月28日 17:05
    Balaji, 

    I received this error:

    Error: Compile Error: Field is not writeable: Project_Setting__c.total_check__c at line 7 column 9
0/9000