You need to sign in to do that
Don't have an account?
Harsha508
updating date
Hi guys i am new to salesforce when i tried to update the date its showing Method does not exist or incorrect signature: TODAY()
please let me know how to do
here its my code
public class updatedate
{
public date update1()
{
Student__c s1 = [ select Closed_Date__c from Student__c];
if(s1.Closed_Date__c == null)
{
s1.Closed_Date__c = TODAY();
upsert s1;
}
}
public updatedate()
{
updatedate u = new updatedate();
u.update1();
}
}
thanks advance
Replace Today() with System.Today(). In SF to get todays date we have to use as System.Today();.
Can you post your Vf page also.Seems there are mistakes in your class
and now its saying that non void method might not return a value might have statement after return statement
i changed the code but still it saying non-void method might not return a value or might have statement after a return statement i not able to get it can any one please tell me why its saying
public class updatedate
{
public Student__c update1()
{
list<Student__c> st = new list<Student__c>();
for(Student__c s:[select Closed_Date__c from Student__c where Closed_Date__c = null])
{
s.Closed_Date__c = System.Today();
insert s;
return null;
}
}
public updatedate()
{
updatedate u = new updatedate();
u.update1();
}
}
Your return value should be outside the for loop. How you are going to use this class?