1

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

Had to change last line to

years.add((record.Schedule_Development_r.YearNumber_c).intvalue());

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.