Try this: :) var selected = event.target.checked; //true or false


CloseDate is a required field for all Opportunities. It's one of those things that we can't change. So, you can't really remove that particular piece of code. You can change it to be something else but, one way or another, CloseDate must be set.


This is your issue: Task newtask = new task(); newtask=task; // from the page input fields You're not copying fields from task to newtask here; you're assigning the same object instance. When you're finished, listrecurringtaskWrapper will contain the same object N times. Instead, copy specific fields from task to newtask, or use the clone() method to ...


You could use some dynamic Apex: Contact[] records = [SELECT ... FROM ... WHERE ...]; SObjectField[] fields = new SObjectField[] { Opportunity.Amount1__c, Opportunity.Amount2__c, Opportunity.Amount3__c, Opportunity.Amount4__c }; Opportunity opp = new Opportunity(); // other fields here // for(Integer i = 0, s = Math.min(records.size(), fields.size()); i &...

Only top voted, non community-wiki answers of a minimum length are eligible