You need to sign in to do that
Don't have an account?
madhu l 1
[Error] Error: Compile Error: Method does not exist or incorrect signature: ApexPages.Upload(ApexPages.Message) at line 17 column 21
public class CountryClub
{
public Document imageURL{ get; set; }
public CountryClub()
{
imageURL= new Document();
}
public PageReference Upload()
{
imageURL.AuthorId = UserInfo.getUserId();
imageURL.FolderId = UserInfo.getUserId(); // put it in running user's folder
try {
insert imageURL;
} catch (DMLException e) {
ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
}
//Add more logic here
return null;
}
public PageReference Browse()
{
imageURL.AuthorId = UserInfo.getUserId();
imageURL.FolderId = UserInfo.getUserId(); // put it in running user's folder
try {
insert imageURL;
} catch (DMLException e) {
ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
}
//Add more logic here
return null;
}
}
please find this error
[Error] Error: Compile Error: Method does not exist or incorrect signature: ApexPages.Upload(ApexPages.Message) at line 17 column 21
public class CountryClub
{
public Document imageURL{ get; set; }
public CountryClub()
{
imageURL= new Document();
}
public PageReference Upload()
{
imageURL.AuthorId = UserInfo.getUserId();
imageURL.FolderId = UserInfo.getUserId(); // put it in running user's folder
try {
insert imageURL;
} catch (DMLException e) {
ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
}
//Add more logic here
return null;
}
public PageReference Browse()
{
imageURL.AuthorId = UserInfo.getUserId();
imageURL.FolderId = UserInfo.getUserId(); // put it in running user's folder
try {
insert imageURL;
} catch (DMLException e) {
ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
}
//Add more logic here
return null;
}
}
I found that you have used 'addimage' method for ApexPages, but it is not any method, you have to use 'addMessage' instead, everywhere in your code.
Like instead of:
ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
Use this:
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
If this help, please mark as best answer so will help others also.
Thanks,
Neetu