function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Darth PlagueisDarth Plagueis 

method does not exist / incorrect signature

Hey Everyone... any help is greatly appreciated. Finally reaching out as I can not see what the heck I am doing wrong here.

I am just trying to grab string data from the request URL  - code originally worked fine without the encodingutil class on simple reports - however as reports got more complex with special characters I would recieve the BLOB is not a valid UTF-8 format - so I introduced the base64string and now I am receiving this error.

Help before dreamforce recieve an extra special prize!

Thanks everyone!
Justin

public class CSVexport {
    public static Boolean isTest;
    public static String strEmailAddr;
    public static String strOut;
    public static Boolean restRequested;
    public String strEmail{get;set;}
    public String strRptname{get;set;}
    public static base64string;
   
    void CSVexport () {
        strOut = '';       
        }

   public String getCSVexport() {
        restRequested = System.isFuture() || System.isScheduled();
        executeRpt();
        return strOut;
        }
 
    public void executeRpt() {
        String requestURL;
        requestURL = '/' + strRptname + '?csv=1&exp=1';
        strOut = new PageReference(requestURL).getContent().toString();
        base64string = EncodingUtil.base64Encode(base64string);
        System.debug('CALLING executeRpt:  output= ' + strOut );
    }

}
James LoghryJames Loghry
Which line is the error coming from?

Is this supposed to be a constructor?
void CSVexport () {
        strOut = '';       
        }

If so, you'll need to change it to:

public CSVexport(){
    strOut = '';       
}


kevin lamkevin lam
I think you're missing the data type of the base64string variable.
Akshay DeshmukhAkshay Deshmukh
Hi,

1. I think James is right.
your contructor's return type is "void" which is not possible.and Hence the error.

Constructor can never have return types.
it should be " public CSVexport(){  . . . }

2. if you  are done with constructor and still get an error.
Please provide some more info about
"base64string = EncodingUtil.base64Encode(base64string);"

I think you should check parameter you are passing to "base64Encode" method