• madhu l 1
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 3
    Replies



[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;
    }
}

[Error] Error: Compile Error: Initial term of field expression must be a concrete SObject: String at line 6 column 12


public class CountryClub {

    public String imageURL{ get; set; }

    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;
    

}
}
[Error] Error: Compile Error: expecting a semi-colon, found '(' at line 22 column 31

public class CountryClub {

    public String imageURL { get; set; }

    public PageReference Upload() {
           image.AuthorId = UserInfo.getUserId(); 
           image.FolderId = UserInfo.getUserId(); // put it in running user's folder 
             try { 
              insert document; 
               } catch (DMLException e) { 

               ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file')); 




    //Add more logic here
        return null;
    }


    public PageReference Browse() {

image.AuthorId = UserInfo.getUserId(); 
           image.FolderId = UserInfo.getUserId(); // put it in running user's folder 
             try { 
              insert document; 
               } catch (DMLException e) { 

               ApexPages.addimage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));

    //Add more logic here
        return null;
    }

}


 


<apex:page controller="CountryClub" showheader="false" sidebar="false"> <apex:form> <apex:pageblock> <apex:pageBlockButtons> <apex:commandButton action="{!Browse}" value="Open"/> <apex:commandButton action="{!Upload}" value="save"/> </apex:pageBlockButtons> <apex:pageblocksection> <apex:image url="{!imageURL}"/> </apex:pageblocksection> </apex:pageblock> </apex:form> </apex:page>
 

<apex:page controller="CountryClub" showheader="false" sidebar="false">

    <apex:form>
      <apex:image url="{!imageURL}">
    </apex:image></apex:form>
<apex:pageBlockButtons>
            <apex:commandButton action="Browse" value="Open"/>
            <apex:commandButton action="Upload" value="save"/>
        </apex:pageBlockButtons>

</apex:page>
the buttons are 1.brows,2.upload are one line,under that line 1.store,2.reset buttons please help me


<apex:page controller="CountryClub" showheader="false" sidebar="false"> <apex:form> <apex:pageblock> <apex:pageBlockButtons> <apex:commandButton action="{!Browse}" value="Open"/> <apex:commandButton action="{!Upload}" value="save"/> </apex:pageBlockButtons> <apex:pageblocksection> <apex:image url="{!imageURL}"/> </apex:pageblocksection> </apex:pageblock> </apex:form> </apex:page>
 

<apex:page controller="CountryClub" showheader="false" sidebar="false">

    <apex:form>
      <apex:image url="{!imageURL}">
    </apex:image></apex:form>
<apex:pageBlockButtons>
            <apex:commandButton action="Browse" value="Open"/>
            <apex:commandButton action="Upload" value="save"/>
        </apex:pageBlockButtons>

</apex:page>