You need to sign in to do that
Don't have an account?
Frank Carter
how to set only the month in a date fields
Hello,
I need help. I have a method that receives a list of custom object. In this object there is a date field already valued. I want update only the month of this date with the current month.
I tried with:
Error: Expression cannot be assigned
Can Someone hepl me?
Thanks,
Francesco
I need help. I have a method that receives a list of custom object. In this object there is a date field already valued. I want update only the month of this date with the current month.
I tried with:
Integer m = Date.Today().Month(); for(Custom_Object__c co: selectedCO) { co.date__c.Month()=m;
Error: Expression cannot be assigned
Can Someone hepl me?
Thanks,
Francesco
newInstance(year, month, date) (static): Constructs a Date from Integer representations of the year, month (1=Jan), and day.
co.date__c = Date.newinstance( co.date__c.year() , m , co.date__c.day() );