• Subha A
  • NEWBIE
  • 59 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 22
    Replies

Hello friends,

 

I have confusion between two things Getter & setter methods and property...........are they same thing or different thing . please write comparison between them.

 

For example - i want to display opportunity against an account in a visual force page.

 

My First Approach : 

public class PrintOpp{
    List<opportunity> oppList;
    
    public List<opportunity> getoppList(){
        if(oppList == null){
            oppList = new List<opportunity>();
            oppList = [select Name,Amount,CloseDate From Opportunity where AccountId =: act.id]; // suppose act is holding account record.
        }    
        return oppList;
    }
}

 another approach :

  

public class PrintOpp{
    public List<opportunity> oppList{
        get{
            if(oppList == null){
                oppList = new List<opportunity>();
                oppList = [select Name,Amount,CloseDate From Opportunity where AccountId =: act.id]; // suppose act is holding account record.
            }    
            return oppList;
        }
        set ;
    }
}

 Today one more confusion arraises to me  when i saw a code  and it's saving also - i used to think in getter setter method get will be followed by varaibale name , But in follwing code get is followed by object name --- please see code below

public class MyCustomController {
public Account acc;
public MyCustomController(){
acc=[select name,id,phone,industry,website,rating,BillingCity,BillingCountry,
ShippingCity,ShippingCountry,AnnualRevenue from Account where id=:Apexpages.currentPage().getParameters().get('id')];
}
public Account getAccount() { // just see get is followed by Object Name i used to think it must be variable name i was accepting it must be only getacc()------- ?????
return acc;
}
public PageReference saveMethod()
{
update acc;
PageReference pf=new apexPages.StandardController(acc).view();
return pf;
}

}

 

Hi,

 

Below is a Visualforce page: NewS3Object

<apex:page standardController="AWS_S3_Object__c" extensions="S3FormController" action="{!constructor}">
    <apex:pageMessages />
    <apex:form >
        <apex:inputHidden value="{!serverURL}" id="hiddenServerURL" />
        <script  type="text/javascript">
            document.getElementById('{!$Component.hiddenServerURL}').value = '{!$Api.Enterprise_Server_URL_140}';           
        </script>       
        
        <apex:pageBlock title="New S3 Object" mode="edit">

            <apex:pageBlockButtons >

                <apex:commandButton action="{!save1}" value="Continue" >
                    <!-- <apex:param name="urlParam" value="{!$Api.Enterprise_Server_URL_140}" />  -->
                </apex:commandButton>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Step 1: Specify Bucket and Object Name" columns="1">
            
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Bucket Name" for="b__name" />
                    <apex:selectList value="{!AWS_S3_Object__c.Bucket_Name__c}"
                        multiselect="false" size="1">
                        <apex:selectOptions value="{!BucketOptions}" />
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <br />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Destination Folder name" for="objName" />
                    <apex:inputField value="{!AWS_S3_Object__c.folderName__c}"
                        id="objName" required="true" onblur="popType(this);" />
                </apex:pageBlockSectionItem>
                <br/>               
                 <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Destination File Name" for="objName" />
                    <apex:inputField value="{!AWS_S3_Object__c.File_Name__c}"
                        id="objName" required="true" onblur="popType(this);" />
                </apex:pageBlockSectionItem>
                
                <br/>
                <apex:pageBlockSectionItem >

                    <apex:outputLabel value="Content Type" />
                    <apex:inputField value="{!AWS_S3_Object__c.Content_Type__c}"
                        id="ctype" required="true" >
                            <script type="text/javascript">
                            function popType(element) {
                             // if there is a suffix , set that value into the content type picklist
                             // add more mime types to the content_type picklist as needed
                             var suffix = element.value.replace(/.*\./,'');
                             if (suffix != null) {
                                document.getElementById('{!$Component.ctype}').value = suffix;
                             }
                            }
                            </script>
                        </apex:inputField>
                </apex:pageBlockSectionItem>

            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 the Controller for above page is : S3FormController

public class S3FormController {
    
  // public String folderName__c = 'apparelFolder';
    public AWSKeys credentials {get;set;}
    private String AWSCredentialName = 'access_apparel'; //Modify this string variable to be the name of the AWS Credential record that contains the proper AWS keys and secret
    public string secret { get {return credentials.secret;} }
    public string key { get {return credentials.key;} }
    
    public AWS_S3_Object__c record; //  { get { return (AWS_S3_Object__c)con.getRecord(); }}
    public S3.AmazonS3 as3 { get; private set; }
    public String serverURL {get;set;}
    
    ApexPages.StandardController con;
    public S3FormController(ApexPages.StandardController stdController) {
        this.con = stdController;
        system.debug( con.getRecord() );
        try { 
        this.record = [select id,bucket_name__c,content_type__c,folderName__c,file_name__c, access__c from AWS_S3_Object__c where id = :con.getRecord().id limit 1];
        } catch( Exception ee) { 
            this.record = new   AWS_S3_Object__c(); 
        }
        //as3 = new S3.AmazonS3(credentials.key,credentials.secret);
    }
    
    
     /*
       This method is called when the news3object Visualforce page is loaded. It verifies that the AWS Keys can be found
       in the AWSKeys__c custom object by the specified name, as set in the string variable AWSCredentialsName. 
       
       Any errors are added to the ApexPage and displayed in the Visualforce page. 
    */
    public PageReference constructor(){
        try{
            
            credentials = new AWSKeys(AWSCredentialName);
            as3 = new S3.AmazonS3(credentials.key,credentials.secret);
        
        }catch(AWSKeys.AWSKeysException AWSEx){
             System.debug('Caught exception in AWS_S3_ExampleController: ' + AWSEx);
             ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, AWSEx.getMessage());
             ApexPages.addMessage(errorMsg);
             //throw new AWSKeys.AWSKeysException(AWSEx);
             //ApexPages.addMessage(AWSEx);    
        }   
    
       return null; 
    }
    

    datetime expire = system.now().addDays(1);
    String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+
        expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';           
          
    string policy { get {return 
        '{ "expiration": "'+formattedexpire+'","conditions": [ {"bucket": "'+
        record.Bucket_Name__c +'" } ,{ "acl": "'+
        record.Access__c +'" },'+
    //  '{"success_action_status": "201" },'+
        '{"content-type":"'+record.Content_Type__c+'"},'+
        '{"success_action_redirect": "https://'+serverurl+'/'+record.id+'"},' +
        '["starts-with", "$key", ""] ]}';   } } 
    
    public String getPolicy() {
        return EncodingUtil.base64Encode(Blob.valueOf(policy));
    }
    
    public String getSignedPolicy() {    
        return make_sig(EncodingUtil.base64Encode(Blob.valueOf(policy)));        
    }
    
    // tester
    public String getHexPolicy() {
        String p = getPolicy();
        return EncodingUtil.convertToHex(Blob.valueOf(p));
    }
    
    //method that will sign
    private String make_sig(string canonicalBuffer) {        
        String macUrl ;
        String signingKey = EncodingUtil.base64Encode(Blob.valueOf(secret));
        Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(canonicalBuffer),blob.valueof(Secret)); 
        macUrl = EncodingUtil.base64Encode(mac);                
        return macUrl;
    }
    
    public String bucketToList {get;set;}
    public List<SelectOption> getBucketOptions(){
        try{
            Datetime now = Datetime.now();
            S3.ListAllMyBucketsResult allBuckets = as3.ListAllMyBuckets(
                key,now,as3.signature('ListAllMyBuckets',now));
            
            List<SelectOption> options = new List<SelectOption>();
            
            for(S3.ListAllMyBucketsEntry bucket:  allBuckets.Buckets.Bucket ){
                options.add(new SelectOption(bucket.Name,bucket.Name)); 
            }
            return options;
        }catch (System.NullPointerException e) {
           return null;
        }catch(Exception ex){
           //System.debug(ex);
           System.debug('caught exception in listallmybuckets');
           ApexPages.addMessages(ex);
           return null; 
        }
    }
    
    public pageReference save1() {
        con.save();
        PageReference p = new PageReference('/apex/news3object2?id='+ con.getRecord().id );
        p.getParameters().put('urlParam',serverURL);
        p.setRedirect(true);
        return p;   
    }
    
    public pageReference page2onLoad(){
       PageReference tempPageRef = constructor();
       // Need to get the salesforce.com server from the URL
       System.debug('serverURL: ' +  ApexPages.currentPage().getParameters().get('urlParam'));
       serverURL = ApexPages.currentPage().getParameters().get('urlParam');
       //System.debug('serverURL: ' + serverURL);
       String urlDomain = serverURL.substring(serverURL.indexOf('://')+3,serverURL.indexOf('/services'));
       System.debug('URL Domain: ' + urlDomain);
       serverURL = urlDomain;
       return null; 
    }

         
    public static testmethod void t1() {
        AWS_S3_Object__c a = new AWS_S3_Object__c();
        
        S3FormController s3 = new S3FormController(
            new ApexPages.StandardController( a ) );
        
        AWSKey__c testKey = new AWSKey__c(name='test keys',key__c='key',secret__c='secret');
        insert testKey;

        s3.AWSCredentialName = testKey.name;
        s3.constructor();
        system.debug( s3.secret + ' '+ s3.key ); 
        system.debug( s3.getpolicy() ); 
        system.debug( s3.getSignedPolicy() ); 
        system.debug( s3.getHexPolicy() ); 
        
        PageReference pageRef = Page.news3object;
        pageRef.getParameters().put('urlParam','https://na22.salseforce.com/services/soap/14.0/c/');
        Test.setCurrentPage(pageRef);
        
        s3.save1();
        s3.page2onLoad(); 
        system.debug( s3.getBucketOptions() );
    }
    
    public static testmethod void t2() {
        AWS_S3_Object__c a = new AWS_S3_Object__c();
        S3FormController s3 = new S3FormController(new ApexPages.StandardController( a ) );
        s3.AWSCredentialName = 'bad key name';
        s3.constructor();
    }
}

 and when the Button "Continue" is clicked it is redirected to another page with same controller called NewS3Object2

<apex:page standardController="AWS_S3_Object__c" extensions="S3FormController" action="{!page2onLoad}">

    <form 
        action="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}" method="post" enctype="multipart/form-data">
        <input type="hidden"  name="key" value="{!AWS_S3_Object__c.folderName__c}/{!AWS_S3_Object__c.File_Name__c}" />
        <input type="hidden"   name="AWSAccessKeyId" value="{!key}" />
        <input type="hidden"  name="policy" value="{!policy}" /> 
        <input type="hidden"  name="signature" value="{!signedPolicy}" /> <input
        type="hidden"  name="acl"
        value="{!AWS_S3_Object__c.Access__c}" /> 
    <!--    <input type="hidden"
        name="success_action_status" value="201">  -->
        
        <input type="hidden"  name="Content-Type" value="{!AWS_S3_Object__c.Content_Type__c}" /> 
        
        <input type="hidden" name="success_action_redirect" value="https://{!serverURL}/{!AWS_S3_Object__c.id}" />
		<apex:pageBlock title="New S3 Object" mode="edit">
        <apex:pageBlockButtons >
            <input class="btn" type="submit" value="Send to Amazon" />
            
            
        </apex:pageBlockButtons>

        <apex:pageBlockSection title="Local File to load" columns="1">

            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Storage Path" />
                <apex:outputText >
            {!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.folderName__c}/{!AWS_S3_Object__c.File_Name__c}
            </apex:outputText>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >

                <apex:outputLabel value="File to upload" />
                <input type="file" size="50" name="file" />
            </apex:pageBlockSectionItem>

        </apex:pageBlockSection>
    </apex:pageBlock></form>

</apex:page>

 How to make the Above two visualforce pages namely NewS3Object and NewS3Object2 into a single Visualforce page with same action and properties. Please Suggest me how to do it.

i want to dispaly the popup for the field value when i doubleclick on that particular field value............example plz(Using javascript or Vf)

 

 

 

thanks

=============

 

VenkatSforce89

How can we pre populate field values based on lookup field value

 

validation inside the text fields in visualdforce page

Account  sobject here two record types (1= test1 (2=test2 but my requirement is Annuaval Revenue field is hide on test2 account but override the buttons new ,view, edit

  • March 04, 2013
  • Like
  • 0

 

 

 

Hi

   I am  working with projects and project contains several task . 

 

when i selected project , i will show all task it contains.

if task clicked , it will open iframe popup. after editing that page need to save and close the iframe popup .and refresh the parent project page.

 

 I did save and close edit task page . but the parent window doesn't refresh.

 

closing popup iframe done by jquery

lilke 

parent.parent.j$("#project-modal").trigger('reveal:close');

 

if i give window.parent.reload();

doesn't work 

 

any help appriciated

 

thanks

Karthik

Hi , I have an if condition in my class which takes url using getUrl method, How to get in test coverage.

 

if(ApexPages.currentPage().getUrl()!=null){

 

}

 

Please somebody can guide me.

Hello friends,

 

I have confusion between two things Getter & setter methods and property...........are they same thing or different thing . please write comparison between them.

 

For example - i want to display opportunity against an account in a visual force page.

 

My First Approach : 

public class PrintOpp{
    List<opportunity> oppList;
    
    public List<opportunity> getoppList(){
        if(oppList == null){
            oppList = new List<opportunity>();
            oppList = [select Name,Amount,CloseDate From Opportunity where AccountId =: act.id]; // suppose act is holding account record.
        }    
        return oppList;
    }
}

 another approach :

  

public class PrintOpp{
    public List<opportunity> oppList{
        get{
            if(oppList == null){
                oppList = new List<opportunity>();
                oppList = [select Name,Amount,CloseDate From Opportunity where AccountId =: act.id]; // suppose act is holding account record.
            }    
            return oppList;
        }
        set ;
    }
}

 Today one more confusion arraises to me  when i saw a code  and it's saving also - i used to think in getter setter method get will be followed by varaibale name , But in follwing code get is followed by object name --- please see code below

public class MyCustomController {
public Account acc;
public MyCustomController(){
acc=[select name,id,phone,industry,website,rating,BillingCity,BillingCountry,
ShippingCity,ShippingCountry,AnnualRevenue from Account where id=:Apexpages.currentPage().getParameters().get('id')];
}
public Account getAccount() { // just see get is followed by Object Name i used to think it must be variable name i was accepting it must be only getacc()------- ?????
return acc;
}
public PageReference saveMethod()
{
update acc;
PageReference pf=new apexPages.StandardController(acc).view();
return pf;
}

}

 

Hi,

 

Below is a Visualforce page: NewS3Object

<apex:page standardController="AWS_S3_Object__c" extensions="S3FormController" action="{!constructor}">
    <apex:pageMessages />
    <apex:form >
        <apex:inputHidden value="{!serverURL}" id="hiddenServerURL" />
        <script  type="text/javascript">
            document.getElementById('{!$Component.hiddenServerURL}').value = '{!$Api.Enterprise_Server_URL_140}';           
        </script>       
        
        <apex:pageBlock title="New S3 Object" mode="edit">

            <apex:pageBlockButtons >

                <apex:commandButton action="{!save1}" value="Continue" >
                    <!-- <apex:param name="urlParam" value="{!$Api.Enterprise_Server_URL_140}" />  -->
                </apex:commandButton>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Step 1: Specify Bucket and Object Name" columns="1">
            
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Bucket Name" for="b__name" />
                    <apex:selectList value="{!AWS_S3_Object__c.Bucket_Name__c}"
                        multiselect="false" size="1">
                        <apex:selectOptions value="{!BucketOptions}" />
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <br />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Destination Folder name" for="objName" />
                    <apex:inputField value="{!AWS_S3_Object__c.folderName__c}"
                        id="objName" required="true" onblur="popType(this);" />
                </apex:pageBlockSectionItem>
                <br/>               
                 <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Destination File Name" for="objName" />
                    <apex:inputField value="{!AWS_S3_Object__c.File_Name__c}"
                        id="objName" required="true" onblur="popType(this);" />
                </apex:pageBlockSectionItem>
                
                <br/>
                <apex:pageBlockSectionItem >

                    <apex:outputLabel value="Content Type" />
                    <apex:inputField value="{!AWS_S3_Object__c.Content_Type__c}"
                        id="ctype" required="true" >
                            <script type="text/javascript">
                            function popType(element) {
                             // if there is a suffix , set that value into the content type picklist
                             // add more mime types to the content_type picklist as needed
                             var suffix = element.value.replace(/.*\./,'');
                             if (suffix != null) {
                                document.getElementById('{!$Component.ctype}').value = suffix;
                             }
                            }
                            </script>
                        </apex:inputField>
                </apex:pageBlockSectionItem>

            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 the Controller for above page is : S3FormController

public class S3FormController {
    
  // public String folderName__c = 'apparelFolder';
    public AWSKeys credentials {get;set;}
    private String AWSCredentialName = 'access_apparel'; //Modify this string variable to be the name of the AWS Credential record that contains the proper AWS keys and secret
    public string secret { get {return credentials.secret;} }
    public string key { get {return credentials.key;} }
    
    public AWS_S3_Object__c record; //  { get { return (AWS_S3_Object__c)con.getRecord(); }}
    public S3.AmazonS3 as3 { get; private set; }
    public String serverURL {get;set;}
    
    ApexPages.StandardController con;
    public S3FormController(ApexPages.StandardController stdController) {
        this.con = stdController;
        system.debug( con.getRecord() );
        try { 
        this.record = [select id,bucket_name__c,content_type__c,folderName__c,file_name__c, access__c from AWS_S3_Object__c where id = :con.getRecord().id limit 1];
        } catch( Exception ee) { 
            this.record = new   AWS_S3_Object__c(); 
        }
        //as3 = new S3.AmazonS3(credentials.key,credentials.secret);
    }
    
    
     /*
       This method is called when the news3object Visualforce page is loaded. It verifies that the AWS Keys can be found
       in the AWSKeys__c custom object by the specified name, as set in the string variable AWSCredentialsName. 
       
       Any errors are added to the ApexPage and displayed in the Visualforce page. 
    */
    public PageReference constructor(){
        try{
            
            credentials = new AWSKeys(AWSCredentialName);
            as3 = new S3.AmazonS3(credentials.key,credentials.secret);
        
        }catch(AWSKeys.AWSKeysException AWSEx){
             System.debug('Caught exception in AWS_S3_ExampleController: ' + AWSEx);
             ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, AWSEx.getMessage());
             ApexPages.addMessage(errorMsg);
             //throw new AWSKeys.AWSKeysException(AWSEx);
             //ApexPages.addMessage(AWSEx);    
        }   
    
       return null; 
    }
    

    datetime expire = system.now().addDays(1);
    String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+
        expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';           
          
    string policy { get {return 
        '{ "expiration": "'+formattedexpire+'","conditions": [ {"bucket": "'+
        record.Bucket_Name__c +'" } ,{ "acl": "'+
        record.Access__c +'" },'+
    //  '{"success_action_status": "201" },'+
        '{"content-type":"'+record.Content_Type__c+'"},'+
        '{"success_action_redirect": "https://'+serverurl+'/'+record.id+'"},' +
        '["starts-with", "$key", ""] ]}';   } } 
    
    public String getPolicy() {
        return EncodingUtil.base64Encode(Blob.valueOf(policy));
    }
    
    public String getSignedPolicy() {    
        return make_sig(EncodingUtil.base64Encode(Blob.valueOf(policy)));        
    }
    
    // tester
    public String getHexPolicy() {
        String p = getPolicy();
        return EncodingUtil.convertToHex(Blob.valueOf(p));
    }
    
    //method that will sign
    private String make_sig(string canonicalBuffer) {        
        String macUrl ;
        String signingKey = EncodingUtil.base64Encode(Blob.valueOf(secret));
        Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(canonicalBuffer),blob.valueof(Secret)); 
        macUrl = EncodingUtil.base64Encode(mac);                
        return macUrl;
    }
    
    public String bucketToList {get;set;}
    public List<SelectOption> getBucketOptions(){
        try{
            Datetime now = Datetime.now();
            S3.ListAllMyBucketsResult allBuckets = as3.ListAllMyBuckets(
                key,now,as3.signature('ListAllMyBuckets',now));
            
            List<SelectOption> options = new List<SelectOption>();
            
            for(S3.ListAllMyBucketsEntry bucket:  allBuckets.Buckets.Bucket ){
                options.add(new SelectOption(bucket.Name,bucket.Name)); 
            }
            return options;
        }catch (System.NullPointerException e) {
           return null;
        }catch(Exception ex){
           //System.debug(ex);
           System.debug('caught exception in listallmybuckets');
           ApexPages.addMessages(ex);
           return null; 
        }
    }
    
    public pageReference save1() {
        con.save();
        PageReference p = new PageReference('/apex/news3object2?id='+ con.getRecord().id );
        p.getParameters().put('urlParam',serverURL);
        p.setRedirect(true);
        return p;   
    }
    
    public pageReference page2onLoad(){
       PageReference tempPageRef = constructor();
       // Need to get the salesforce.com server from the URL
       System.debug('serverURL: ' +  ApexPages.currentPage().getParameters().get('urlParam'));
       serverURL = ApexPages.currentPage().getParameters().get('urlParam');
       //System.debug('serverURL: ' + serverURL);
       String urlDomain = serverURL.substring(serverURL.indexOf('://')+3,serverURL.indexOf('/services'));
       System.debug('URL Domain: ' + urlDomain);
       serverURL = urlDomain;
       return null; 
    }

         
    public static testmethod void t1() {
        AWS_S3_Object__c a = new AWS_S3_Object__c();
        
        S3FormController s3 = new S3FormController(
            new ApexPages.StandardController( a ) );
        
        AWSKey__c testKey = new AWSKey__c(name='test keys',key__c='key',secret__c='secret');
        insert testKey;

        s3.AWSCredentialName = testKey.name;
        s3.constructor();
        system.debug( s3.secret + ' '+ s3.key ); 
        system.debug( s3.getpolicy() ); 
        system.debug( s3.getSignedPolicy() ); 
        system.debug( s3.getHexPolicy() ); 
        
        PageReference pageRef = Page.news3object;
        pageRef.getParameters().put('urlParam','https://na22.salseforce.com/services/soap/14.0/c/');
        Test.setCurrentPage(pageRef);
        
        s3.save1();
        s3.page2onLoad(); 
        system.debug( s3.getBucketOptions() );
    }
    
    public static testmethod void t2() {
        AWS_S3_Object__c a = new AWS_S3_Object__c();
        S3FormController s3 = new S3FormController(new ApexPages.StandardController( a ) );
        s3.AWSCredentialName = 'bad key name';
        s3.constructor();
    }
}

 and when the Button "Continue" is clicked it is redirected to another page with same controller called NewS3Object2

<apex:page standardController="AWS_S3_Object__c" extensions="S3FormController" action="{!page2onLoad}">

    <form 
        action="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}" method="post" enctype="multipart/form-data">
        <input type="hidden"  name="key" value="{!AWS_S3_Object__c.folderName__c}/{!AWS_S3_Object__c.File_Name__c}" />
        <input type="hidden"   name="AWSAccessKeyId" value="{!key}" />
        <input type="hidden"  name="policy" value="{!policy}" /> 
        <input type="hidden"  name="signature" value="{!signedPolicy}" /> <input
        type="hidden"  name="acl"
        value="{!AWS_S3_Object__c.Access__c}" /> 
    <!--    <input type="hidden"
        name="success_action_status" value="201">  -->
        
        <input type="hidden"  name="Content-Type" value="{!AWS_S3_Object__c.Content_Type__c}" /> 
        
        <input type="hidden" name="success_action_redirect" value="https://{!serverURL}/{!AWS_S3_Object__c.id}" />
		<apex:pageBlock title="New S3 Object" mode="edit">
        <apex:pageBlockButtons >
            <input class="btn" type="submit" value="Send to Amazon" />
            
            
        </apex:pageBlockButtons>

        <apex:pageBlockSection title="Local File to load" columns="1">

            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Storage Path" />
                <apex:outputText >
            {!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.folderName__c}/{!AWS_S3_Object__c.File_Name__c}
            </apex:outputText>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >

                <apex:outputLabel value="File to upload" />
                <input type="file" size="50" name="file" />
            </apex:pageBlockSectionItem>

        </apex:pageBlockSection>
    </apex:pageBlock></form>

</apex:page>

 How to make the Above two visualforce pages namely NewS3Object and NewS3Object2 into a single Visualforce page with same action and properties. Please Suggest me how to do it.

Hi,

 
There is a Custom object(tab) say EgA which when opened has new button to enter new data records,
the new button is overridden with custom visualforce page(VF1) which has some input fields and also continue button at end of VF1 page when clicked it is redirected to another page say VF2.
In VF2 also there is a button at the end "Upload" when clicked, all data records entered on VF1 & VF2 are stored as data records in that custom object.
VF1 
<apex:page standardController="EgA__c" extensions="EgAController" action="{!constructor}">
 
VF2
<apex:page standardController="EgA__c" extensions="EgAController" action="{!page2onLoad}">
 
 I need both pages VF1 and VF2 as a single visualforcepage  say VF but as seen above each page have a common controller  with different apex page actions.
 
I tried to bring all the forms from VF2 and had written in VF1 but even there is some problem which i could understand please help me 
Thanks In advance!

 

my case object have Time_of_first_Type_Change__c fieild 

   i want timestamp value in this field  if the case type was first changed by a regular user (not AeroDefault)

if change the type field to another value the Time_of_first_Type_Change__c value doesnot change

 

please help me

 

thanks&regards

sai

Hi 

 

   I would like to give dynamic ids based on the no of result which I get.

 

Like 

 

newTextBoxDiv.after().html('<table><tr><td><input type="text" name="textbox' + counter +
'" id="textbox' + counter + '" value="" style="padding:5px 0px 0px 0px;" ></td><td style="display: block;"><img src="r-arrow.png" alt="" onClick="functionCall(this.id)" id="textBox2RightArrowImage1' + counter + '"></td>'+
'<td style="display: none;"><img src="d-arrow.png" alt="" id="textBox2DownArrowImage1' + counter + '"></td></tr></table>');

 

it is working in html but not in apex.

 

 

Any help is appreciated.

  • February 26, 2013
  • Like
  • 0

Hello everyone,

 

I have got a requirement where there is a list of records in a table, so when clicked on any row, then an action should perform showing its subsequent records in another table and at the same time if clicked on the value in the table row, then page should redirect to another page where it displays the value's overview.

 

I did get one of the above mentioned functionality, like when clicked on the value in the table row, the page gets redirected to its overview page.

 

So, is it possible to hvae 2 onclick events or 2 action function for a single command link.

 

Best Regards

i created a custom object with name Meeting Master in this i have to create a custom formula text field value of this custom field hould be name of owner of this record i select formula then field type to text after that when formula window come 

then i write OwnerId its a correct field but when i write Owner.name it is saying owner is not a valid field??please tell the formula how to set value of formula field to owner name??