• Integrator9
  • NEWBIE
  • 50 Points
  • Member since 2012

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

Hi,

 

I am Using a Visualforce Page with HTML Form which POST s Data to a URL.

 

When i Click Submit (HTML) Button the form action is calling a External URL(which i am sending Data) , and on that Page some response is Displayed.

 

Can we get that response back to Visualforce or Pass to Controller so that I can save that back in Salesforce.

 

Please suggest any solution.

 

Thanks in advance.

 

My Form Code:

<apex:page>

<form name="form1" method="post" action= "https://www1.abc.com/partners/abcd/" target="blank">
<input type="submit" name="Submit" value="Initiate"/>
<input type="hidden" name="ExpressXML" value="{!XML}"/>

</form>

</apex:page>

 

 

Hi I am Trying to Delete a Object/ file from my Amazon S3 Bucket using following class

 

But i am facing issues with Signature.

 

Looking for any Help/ Suggestions

 

Public Class FD{

Public String SECRETACCESSKEY {get;set;}
Public String KEY {get;set;}
Public String BUCKET {get;set;}
Public String SIGNATURE {get;set;}
Public String FILENAME {get;set;}
Public String STRINGTOSIGN {get;set;}
Public String policy {get;set;}

datetime expire = DateTime.now().addSeconds(10);

long epochexpire=(expire.gettime()/1000);

String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+

expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';
Public string redirectURL{get;set;}

Public string documentPath {get;set;}

Public pagereference FD(){


SECRETACCESSKEY = 'mysecret';
KEY ='mykey' ;
BUCKET ='mybucket';
FILENAME ='a00U000000446as.docx';

String HIDATE = 'Fri, 12 Oct 2012 15:02:13 GMT';


policy ='DELETE\n\n\n'+(expire.gettime()/1000)+'\nx-amz-date:'+HIDATE+'\n/'+Bucket+'/'+filename;
System.debug('canonical = ' + policy );
Blob bsig = Crypto.generateMac('HmacSHA1', Blob.valueOf(policy), Blob.valueOf(SECRETACCESSKEY));


signature = EncodingUtil.base64Encode(bsig);

System.debug('SIGNATURE = ' + signature);


documentPath='https://s3.amazonaws.com/'+Bucket+'/';

redirectURL=documentPath+filename+'?x-amz-date='+HIDATE+'&AWSAccessKeyId='+key+'&Signature='+Signature+'&Expires='+epochexpire;



pagereference p=new pagereference(redirectURL);
system.debug('....path.....'+p);
System.debug('epochtime'+epochexpire);
p.setRedirect(true);
return p;
}

 

}

 

 

Thanks in advance

Hi I am Trying to Delete a Object/ file from my Amazon S3 Bucket using following class

 

But i am facing issues with Signature.

 

Looking for any Help/ Suggestions

 

Public Class FD{

Public String SECRETACCESSKEY {get;set;}
Public String KEY {get;set;}
Public String BUCKET {get;set;}
Public String SIGNATURE {get;set;}
Public String FILENAME {get;set;}
Public String STRINGTOSIGN {get;set;}
Public String policy {get;set;}

datetime expire = DateTime.now().addSeconds(10);

long epochexpire=(expire.gettime()/1000);

String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+

expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';
Public string redirectURL{get;set;}

Public string documentPath {get;set;}

Public pagereference FD(){


SECRETACCESSKEY = 'mysecret';
KEY ='mykey' ;
BUCKET ='mybucket';
FILENAME ='a00U000000446as.docx';

String HIDATE = 'Fri, 12 Oct 2012 15:02:13 GMT';


policy ='DELETE\n\n\n'+(expire.gettime()/1000)+'\nx-amz-date:'+HIDATE+'\n/'+Bucket+'/'+filename;
System.debug('canonical = ' + policy );
Blob bsig = Crypto.generateMac('HmacSHA1', Blob.valueOf(policy), Blob.valueOf(SECRETACCESSKEY));


signature = EncodingUtil.base64Encode(bsig);

System.debug('SIGNATURE = ' + signature);


documentPath='https://s3.amazonaws.com/'+Bucket+'/';

redirectURL=documentPath+filename+'?x-amz-date='+HIDATE+'&AWSAccessKeyId='+key+'&Signature='+Signature+'&Expires='+epochexpire;



pagereference p=new pagereference(redirectURL);
system.debug('....path.....'+p);
System.debug('epochtime'+epochexpire);
p.setRedirect(true);
return p;
}

 

}

 

 

Thanks in advance

Hi,

 

I am Using a Visualforce Page with HTML Form which POST s Data to a URL.

 

When i Click Submit (HTML) Button the form action is calling a External URL(which i am sending Data) , and on that Page some response is Displayed.

 

Can we get that response back to Visualforce or Pass to Controller so that I can save that back in Salesforce.

 

Please suggest any solution.

 

Thanks in advance.

 

My Form Code:

<apex:page>

<form name="form1" method="post" action= "https://www1.abc.com/partners/abcd/" target="blank">
<input type="submit" name="Submit" value="Initiate"/>
<input type="hidden" name="ExpressXML" value="{!XML}"/>

</form>

</apex:page>

 

 

Hi I am Trying to Delete a Object/ file from my Amazon S3 Bucket using following class

 

But i am facing issues with Signature.

 

Looking for any Help/ Suggestions

 

Public Class FD{

Public String SECRETACCESSKEY {get;set;}
Public String KEY {get;set;}
Public String BUCKET {get;set;}
Public String SIGNATURE {get;set;}
Public String FILENAME {get;set;}
Public String STRINGTOSIGN {get;set;}
Public String policy {get;set;}

datetime expire = DateTime.now().addSeconds(10);

long epochexpire=(expire.gettime()/1000);

String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+

expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';
Public string redirectURL{get;set;}

Public string documentPath {get;set;}

Public pagereference FD(){


SECRETACCESSKEY = 'mysecret';
KEY ='mykey' ;
BUCKET ='mybucket';
FILENAME ='a00U000000446as.docx';

String HIDATE = 'Fri, 12 Oct 2012 15:02:13 GMT';


policy ='DELETE\n\n\n'+(expire.gettime()/1000)+'\nx-amz-date:'+HIDATE+'\n/'+Bucket+'/'+filename;
System.debug('canonical = ' + policy );
Blob bsig = Crypto.generateMac('HmacSHA1', Blob.valueOf(policy), Blob.valueOf(SECRETACCESSKEY));


signature = EncodingUtil.base64Encode(bsig);

System.debug('SIGNATURE = ' + signature);


documentPath='https://s3.amazonaws.com/'+Bucket+'/';

redirectURL=documentPath+filename+'?x-amz-date='+HIDATE+'&AWSAccessKeyId='+key+'&Signature='+Signature+'&Expires='+epochexpire;



pagereference p=new pagereference(redirectURL);
system.debug('....path.....'+p);
System.debug('epochtime'+epochexpire);
p.setRedirect(true);
return p;
}

 

}

 

 

Thanks in advance

Hi I am Trying to Delete a Object/ file from my Amazon S3 Bucket using following class

 

But i am facing issues with Signature.

 

Looking for any Help/ Suggestions

 

Public Class FD{

Public String SECRETACCESSKEY {get;set;}
Public String KEY {get;set;}
Public String BUCKET {get;set;}
Public String SIGNATURE {get;set;}
Public String FILENAME {get;set;}
Public String STRINGTOSIGN {get;set;}
Public String policy {get;set;}

datetime expire = DateTime.now().addSeconds(10);

long epochexpire=(expire.gettime()/1000);

String formattedexpire = expire.formatGmt('yyyy-MM-dd')+'T'+

expire.formatGmt('HH:mm:ss')+'.'+expire.formatGMT('SSS')+'Z';
Public string redirectURL{get;set;}

Public string documentPath {get;set;}

Public pagereference FD(){


SECRETACCESSKEY = 'mysecret';
KEY ='mykey' ;
BUCKET ='mybucket';
FILENAME ='a00U000000446as.docx';

String HIDATE = 'Fri, 12 Oct 2012 15:02:13 GMT';


policy ='DELETE\n\n\n'+(expire.gettime()/1000)+'\nx-amz-date:'+HIDATE+'\n/'+Bucket+'/'+filename;
System.debug('canonical = ' + policy );
Blob bsig = Crypto.generateMac('HmacSHA1', Blob.valueOf(policy), Blob.valueOf(SECRETACCESSKEY));


signature = EncodingUtil.base64Encode(bsig);

System.debug('SIGNATURE = ' + signature);


documentPath='https://s3.amazonaws.com/'+Bucket+'/';

redirectURL=documentPath+filename+'?x-amz-date='+HIDATE+'&AWSAccessKeyId='+key+'&Signature='+Signature+'&Expires='+epochexpire;



pagereference p=new pagereference(redirectURL);
system.debug('....path.....'+p);
System.debug('epochtime'+epochexpire);
p.setRedirect(true);
return p;
}

 

}

 

 

Thanks in advance

I have a approval in process to post the attachments to Chatter, 

 

If a record is Approved which is created through UI with attachments, I am able to view the preview of Attachments.

 

I am not able to see the preview of attachments after approval of records  created through inbound email.

 

Is any thing i need to add in the code or?

 

public class EmailParsingActivity {
    
    public void attachToRecord(Messaging.InboundEmail.BinaryAttachment[] bAttachments, ID abcdRecId) {     
        String contents='';                       //ok
        List<Attachment> listAttach = new List<Attachment>();

        if(bAttachments != null) {
            for(Messaging.InboundEmail.BinaryAttachment bAttach : bAttachments){  //ok
                system.debug('attach file name ' + bAttach.filename);
                
                Attachment attach = new Attachment();
                
                //attach.Body = Blob.valueOf(bAttach.body.toString());
                String b64Data = EncodingUtil.base64Encode(bAttach.body);
                //Blob bab = bAttach.body;
                attach.Body = Blob.valueOf(b64Data);
                attach.Name = bAttach.filename;    // name of the attachement should be same a attached to email
                //attach.parentId = submitRecord.Id;
                attach.parentId = abcdRecId;
                listAttach.add(attach);        
            }
            system.debug('attach list size ' + listAttach.size());
            insert listAttach;
        }
    }
    
}

 

I would appreciate if someone assist me with the solution. Thanks in Advance-----

Hi ,

 

I want to integrate Facbook and Twitter application with my salesforce application. Can Any1 help me how to post and update status on Facbook wall and Twitter Using HTTP Request(OAuth). Is there any sample code available then please share.

 

Thanks!