Not understanding issue with code below. The Schedule_Development_r.YearNumber_c field is a formula field that returns a number (4,0). Its there to convert a picklist of years such as '2013', '2014' etc into Integers for comparison in Apex.

Keep getting "Incompatible Decimal Element Type For Integer Set" in class below for last line.

Set years = new Set();//, month = new Set(); For(Schedule_Connection__c record : schconnids) { years.add(record.Schedule_Development_r.YearNumber_c);

Note: schconnids = List I also tried just creating a number field (4,0) in SFDC and getting same error.

1 Answer 1


Had to change last line to


Had tried that but forgot () after intvalue so was getting a compile error!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .