• Mujtaba Saleforce Dev
  • NEWBIE
  • 0 Points
  • Member since 2016
  • The Gent
  • Own


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

I was using Mavensmate & Sublime (IDE) for a long time.
Everything worked fine until last week.

After refreshed a sandbox, i can't no longer login Salesforce through Mavensmate with this error:

We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator.
1800 : There was a problem in setting up your remote access


Any idea will be appreciated.
Hi everyone,
I am getting an error on below mentioned line when compiling in an apex class but it runs in Execute Anonymous Window :

msg.setTreatTargetObjectAsRecipient(false);

Error : Save error: Method does not exist or incorrect signature: [Messaging.SingleEmailMessage].setTreatTargetObjectAsRecipient(Boolean).
Kindly help. Thanks in advance. 
Hi,
We are replacing native functionality of Attachments to upload files to "Box"external storage using Rest API, I was able to upload small files upto 5MB but when trying to upload big files I get the error in Apex code (not even going to box) 
System.StringException: String length exceeds maximum: 6000000
This is occurig when trying to decoding ( base64Decode ) from String blob before Rest API call, please check the code.
String bodyEncoded = EncodingUtil.base64Encode(fileBody);
Blob bodyBlob = null;
String last4Bytes = bodyEncoded.substring(bodyEncoded.length()-4,bodyEncoded.length());
// GW: replacement section to get rid of padding without corrupting data
if(last4Bytes.endsWith('==')) {
    last4Bytes = last4Bytes.substring(0,2) + '0K';
    bodyEncoded = bodyEncoded.substring(0,bodyEncoded.length()-4) + last4Bytes;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded); //Here its failing
}else if(last4Bytes.endsWith('=')){
    last4Bytes = last4Bytes.substring(0,3) + 'N';
    bodyEncoded = bodyEncoded.substring(0,bodyEncoded.length()-4) + last4Bytes;
    footer = '\n' + footer;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);              
}else{
    footer = '\r\n' + footer;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);  
}

Error is triggering at "bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);" this line.
Please advice how can we ignore the size of the file? We need to upload at least 10 MB.

Thanks,
Sumant K