• deva m
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hi,

I want upload an image from visualforce page and it has to store in rich text area.

Here i tried it
<apex:page sidebar="false" showHeader="false" standardController="color__c" >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/>
<apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"/>
<script>
    $(function(){
    $('#profile_image').change( function(e) {
        
        var img = URL.createObjectURL(e.target.files[0]);
        $('.image').attr('src', img);
    });
});


</script>
<style>
.image{
    width:120px;
    height:120px
}
</style>
  <apex:form >
  
    <apex:pageBlock >
        <apex:pageBlockSection columns="1" >
         <apex:image value="{!$Resource.icon}" styleClass="image"/>
    <input type="file" id="profile_image" value=""></input>
        </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>


Thanks if any one do this for me
  • December 27, 2014
  • Like
  • 0
Hi,
I create a list button newbranchtask for below vf code.
In this button i gave the url
/apex/branchvfcode?branch1__c?whoid={!Branch__c.Id}

My requirement this vfpage is going to store in Branch__c object .

I tried in differentways but no result

Here is my vf page 
<apex:page standardController="task" >
<apex:form > <apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons> <apex:pageBlockSection columns="2">
<apex:repeat value="{!$ObjectType.task.FieldSets.newtaskinfo}" var="f">
<apex:inputfield value="{!task[f]}" />
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
  • November 28, 2014
  • Like
  • 0
Hi ,
Help out with this problem

public class Acc1
{
 Account acc=new Account();
    public void accmethod()
    {
       
        acc.Name='deva';
     }
}
  • November 28, 2014
  • Like
  • 1
Hi ,
this is deva
Could you please resolve this.

Thanks a ton.

apex class


public class Registration {

public Registration__C str;

    public PageReference Cancel() {
        return null;
    }




    public Registration(ApexPages.StandardController controller) {
this.str = (Registration__C)Controller.getRecord();
    }
     public Registration__c getStr(){
    return str;
    }
    
    public ApexPages.PageReference save() {
 
  ApexPages.StandardController controller = new ApexPages.StandardController(str);
  try {
    controller.save();
  }
  catch(Exception e) {
    return null;
  }
  return controller.view();
}
    


public String classvalue{get;set;}
public Boolean ClassValue1{set;get;}
public Boolean ClassValue2{set;get;}
public Boolean ClassValue3{set;get;}
public Boolean ClassValue4{set;get;}
public Boolean ClassValue5{set;get;}
public Boolean ClassValue6{set;get;}
public Boolean ClassValue7{set;get;}
public Boolean ClassValue8{set;get;}
public Boolean ClassValue9{set;get;}
public Boolean ClassValue10{set;get;}
public Boolean ClassValue11{set;get;}
public Boolean ClassValue12{set;get;}
public Boolean ClassValue13{set;get;}
   
   
        
        
    public void ClassPicklist()
    {
        
        if(str.class__C=='Pre-Kg')
        {
          ClassValue1 = true;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C='LKG')
        {
          ClassValue1 = false;
          ClassValue2 = true;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='UKG')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = true;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='1stClass')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = true;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='2nd Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = true;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        
        }
        else
        if(str.class__C=='3rd Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = true;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='4th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = true;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='5th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = true;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='6th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = true;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='7th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = true;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='8th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = true;
           ClassValue12 = false;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='9th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = true;
           ClassValue13 = false;
        }
        else
        if(str.class__C=='10th Class')
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = true;
        }
        else
        {
          ClassValue1 = false;
          ClassValue2 = false;
           ClassValue3 = false;
           ClassValue4 = false;
           ClassValue5 = false;
           ClassValue6 = false;
           ClassValue7 = false;
           ClassValue8 = false;
           ClassValue9 = false;
           ClassValue10 = false;
           ClassValue11 = false;
           ClassValue12 = false;
           ClassValue13 = false;
         }
     }   
       
    public PageReference Edit() {
        return null;
    }


   
    
    
    
    public String Feevalue{get;set;}
    public Boolean FeeValue1{set;get;}
    public Boolean FeeValue2{set;get;}
    public Boolean FeeValue3{set;get;}
      public List<SelectOption> getFeelist ()
    {
      
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('','--None--'));
        options.add(new SelectOption('1','1st term'));
        options.add(new SelectOption('2','2nd Term'));
        options.add(new SelectOption('3','3rd Term'));
         return options;
    }  
          
    public void FeePicklist()
    {
        Registration__c r=new Registration__C();
        if(Feevalue=='1')
        {
          FeeValue1 = true;
          FeeValue2 = false;
          FeeValue3 = false;
         }
         else
         if(Feevalue=='2')
        {
          FeeValue1 = false;
          FeeValue2 = true;
          FeeValue3 = false;
         }
         else
         if(Feevalue=='3')
        {
          FeeValue1 = false;
          FeeValue2 = false;
          FeeValue3 = true;
         }
         else
         
        {
          FeeValue1 = false;
          FeeValue2 = false;
          FeeValue3 = false;
         }
      }
      
      
      
      
    
    public String HostalFeevalue{get;set;}
    public Boolean HostalFeeValue1{set;get;}
    public Boolean HostalFeeValue2{set;get;}
    public Boolean HostalFeeValue3{set;get;}
      public List<SelectOption> getHostalFeelist ()
    {
      
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('','--None--'));
        options.add(new SelectOption('1','1st term'));
        options.add(new SelectOption('2','2nd Term'));
        options.add(new SelectOption('3','3rd Term'));
         return options;
    }  
          
    public void HostalFeePicklist()
    {
        Registration__c r=new Registration__C();
        if(HostalFeevalue=='1')
        {
          HostalFeeValue1 = true;
          HostalFeeValue2 = false;
          HostalFeeValue3 = false;
         }
         else
         if(HostalFeevalue=='2')
        {
          HostalFeeValue1 = false;
          HostalFeeValue2 = true;
          HostalFeeValue3 = false;
         }
         else
         if(HostalFeevalue=='3')
        {
          HostalFeeValue1 = false;
          HostalFeeValue2 = false;
          HostalFeeValue3 = true;
         }
         else
         
        {
          HostalFeeValue1 = false;
          HostalFeeValue2 = false;
          HostalFeeValue3 = false;
         }
   }

}


Here clas__C is picklist field and registration__c is object

Based on classvalue i have to render the code
  • November 25, 2014
  • Like
  • 0
Hi ,
Help out with this problem

public class Acc1
{
 Account acc=new Account();
    public void accmethod()
    {
       
        acc.Name='deva';
     }
}
  • November 28, 2014
  • Like
  • 1
Hello.

I would like to render all fields in a VF page and I think the repeat function might be the easiest.
<apex:repeat value="{!$ObjectType.Account.Fields.}" var="f">
            <apex:outputfield value="{!Account[f]}"> 
            </apex:outputfield>
        </apex:repeat>
I am missing the last bit though. Is that achievable, or would it need a class that gets all fields and then the repeat function referencing it?

Thanks!
I have to create a Visualforce page and attach that LINK in Email Template to send for my Higher Official ( say XXX ). 
Now when Mr.XXX clicks on the link which I sent, He should have access to EDIT that page. But Salesforce generally not allows that,is that right? 
If I am wrong, give me a solution. 

Thanks in advance :)